README.md in devise_ldap_authenticatable-0.4.3 vs README.md in devise_ldap_authenticatable-0.4.4
- old
+ new
@@ -30,11 +30,11 @@
This will *only* work for Rails 3 applications.
In the Gemfile for your application:
gem "devise", "1.1.1"
- gem "devise_ldap_authenticatable", "0.4.3"
+ gem "devise_ldap_authenticatable", "0.4.4"
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"
@@ -42,23 +42,24 @@
Setup
-----
Run the rails generator
- rails generate devise_ldap_authenticatable:install
+ rails generate devise_ldap_authenticatable:install [options]
This will install the sample.yml, update the devise.rb initializer, and update your user model. There are some options you can pass to it:
- [--user-model=USER_MODEL] # Model to update
- # Default: user
- [--update-model] # Update model to change from database_authenticatable to ldap_authenticatable
- # Default: true
- [--add-rescue] # Update Application Controller with resuce_from for DeviseLdapAuthenticatable::LdapException
- # Default: true
+Options:
+ [--user-model=USER_MODEL] # Model to update
+ # Default: user
+ [--update-model] # Update model to change from database_authenticatable to ldap_authenticatable
+ # Default: true
+ [--add-rescue] # Update Application Controller with resuce_from for DeviseLdapAuthenticatable::LdapException
+ # Default: true
+ [--advanced] # Add advanced config options to the devise initializer
-
Usage
-----
Devise LDAP Authenticatable works in replacement of Database Authenticatable
@@ -94,10 +95,19 @@
* When set to true, the user trying to login will be checked to make sure they have all of the attributes in the ldap.yml file.
* ldap\_use\_admin\_to\_bind _(default: false)_
* When set to true, the admin user will be used to bind to the LDAP server during authentication.
+
+Advanced Configuration
+----------------------
+
+These parameters will be added to `config/initializers/devise.rb` when you pass the `--advanced` switch to the generator:
+
+* ldap\_auth\_username\_builder _(default: `Proc.new() {|attribute, login, ldap| "#{attribute}=#{login},#{ldap.base}" }`)_
+ * You can pass a proc to the username option to explicitly specify the format that you search for a users' DN on your LDAP server.
+
Testing
-------
This has been tested using the following setup:
@@ -137,10 +147,10 @@
This will allow requests to go to the test LDAP server without being signed by a trusted root (it uses a self-signed cert)
References
----------
-* [Original Plugin](http://github.com/cschiewek/devise_ldap_authenticatable)
+* [OpenLDAP](http://www.openldap.org/)
* [Devise](http://github.com/plataformatec/devise)
* [Warden](http://github.com/hassox/warden)
TODO