README.md in devise_ldap_authenticatable-0.4.6 vs README.md in devise_ldap_authenticatable-0.4.7
- old
+ new
@@ -17,23 +17,23 @@
- An LDAP server (tested on OpenLDAP)
- Rails 3.0.0
These gems are dependencies of the gem:
-- Devise 1.1.2
-- net-ldap 0.1.1
+- Devise 1.4.0
+- net-ldap 0.2.2
Installation
------------
**_Please Note_**
This will *only* work for Rails 3 applications.
In the Gemfile for your application:
- gem "devise", "1.1.2"
+ gem "devise", "1.4.0"
gem "devise_ldap_authenticatable"
To get the latest version, pull directly from github instead of the gem:
gem "devise_ldap_authenticatable", :git => "git://github.com/cschiewek/devise_ldap_authenticatable.git"
@@ -72,9 +72,24 @@
**_Please Note_**
This devise plugin has not been tested with DatabaseAuthenticatable enabled at the same time. This is meant as a drop in replacement for DatabaseAuthenticatable allowing for a semi single sign on approach.
The field that is used for logins is the first key that's configured in the `config/devise.rb` file under `config.authentication_keys`, which by default is email. For help changing this, please see the [Railscast](http://railscasts.com/episodes/210-customizing-devise) that goes through how to customize Devise.
+
+
+Querying LDAP
+----------------
+
+Given that ldap\_create\_user is set to true and you are authenticating with username, you can query an LDAP server for other attributes.
+
+in your user model:
+
+ before_save :get_ldap_email
+
+ def get_ldap_email
+ self.email = Devise::LdapAdapter.get_ldap_param(self.username,"mail")
+ end
+
Configuration
-------------
In initializer `config/initializers/devise.rb` :