README.md in devise_ldap_authenticatable-0.8.5 vs README.md in devise_ldap_authenticatable-0.8.6
- old
+ new
@@ -1,31 +1,28 @@
Devise LDAP Authenticatable
===========================
-
-Why this fork?
---------------
-This fork changes a few lines to allow the admin binding to be set to the user trying to log in.
-
[![Gem Version](https://badge.fury.io/rb/devise_ldap_authenticatable.png)](http://badge.fury.io/rb/devise_ldap_authenticatable)
[![Code Climate](https://codeclimate.com/github/cschiewek/devise_ldap_authenticatable.png)](https://codeclimate.com/github/cschiewek/devise_ldap_authenticatable)
[![Dependency Status](https://gemnasium.com/cschiewek/devise_ldap_authenticatable.png)](https://gemnasium.com/cschiewek/devise_ldap_authenticatable)
Devise LDAP Authenticatable is a LDAP based authentication strategy for the [Devise](http://github.com/plataformatec/devise) authentication framework.
If you are building applications for use within your organization which require authentication and you want to use LDAP, this plugin is for you.
Devise LDAP Authenticatable works in replacement of Database Authenticatable. 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.
-For a screencast with an example application, please visit: [http://random-rails.blogspot.com/2010/07/ldap-authentication-with-devise.html](http://random-rails.blogspot.com/2010/07/ldap-authentication-with-devise.html)
+For a screencast with an example application, please visit: [http://corrupt.net/2010/07/05/LDAP-Authentication-With-Devise/](http://corrupt.net/2010/07/05/LDAP-Authentication-With-Devise/)
Prerequisites
-------------
* devise ~> 3.0.0 (which requires rails ~> 4.0)
* net-ldap ~> 0.6.0
Note: Rails 3.x / Devise 2.x has been moved to the 0.7 branch. All 0.7.x gems will support Rails 3, where as 0.8.x will support Rails 4.
+If you are transitioning from having Devise manage your users' passwords in the database to using LDAP auth, you may have to update your `users` table to make `encrypted_password` nullable, or else the LDAP user insert will fail.
+
Usage
-----
In the Gemfile for your application:
gem "devise_ldap_authenticatable"
@@ -81,11 +78,13 @@
* `ldap_update_password` _(default: true)_
* When doing password resets, if true will update the LDAP server. Requires admin password in the ldap.yml
* `ldap_check_group_membership` _(default: false)_
* When set to true, the user trying to login will be checked to make sure they are in all of groups specified in the ldap.yml file.
* `ldap_check_attributes` _(default: false)_
- * 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.
+ * When set to true, the user trying to login will be checked to make sure their attributes match those specified in the ldap.yml file.
+* `ldap_check_attributes_presence` _(default: false)_
+ * When set to true, the user trying to login will be checked against all `require_attribute_presence` attributes in the ldap.yml file, either present _(attr: true)_,or not present _(attr: false)_.
* `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.
* `ldap_check_group_membership_without_admin` _(default: false)_
* When set to true, the group membership check is done with the user's own credentials rather than with admin credentials. Since these credentials are only available to the Devise user model during the login flow, the group check function will not work if a group check is performed when this option is true outside of the login flow (e.g., before particular actions).
@@ -114,23 +113,23 @@
Devise LDAP Authenticatable uses a running OpenLDAP server to do automated acceptance tests. You'll need the executables `slapd`, `ldapadd`, and `ldapmodify`.
On OS X, this is available out of the box.
-On Ubuntu, you can install OpenLDAP with `sudo apt-get install slapd ldap-utils`. If slapd runs under AppArmor, add an exception like this to `/etc/apparmor.d/local/usr.sbin.slapd` to let slapd read our configs.
+On Ubuntu, you can install OpenLDAP with `sudo apt-get install slapd ldap-utils`. If slapd runs under AppArmor, add an exception like this to `/etc/apparmor.d/local/usr.sbin.slapd` to let slapd read our configs (reload using `sudo service apparmor reload` afterwards).
- /path/to/devise_ldap_authenticatable/spec/ldap/** rw,$
+ /path/to/devise_ldap_authenticatable/spec/ldap/** rw,
To start hacking on `devise_ldap_authentication`, clone the github repository, start the test LDAP server, and run the rake test task:
git clone https://github.com/cschiewek/devise_ldap_authenticatable.git
cd devise_ldap_authenticatable
bundle install
# in a separate console or backgrounded
./spec/ldap/run-server
- bundle exec rake db:migrate # first time only
+ RAILS_ENV=test bundle exec rake db:migrate # first time only
bundle exec rake spec
References
----------
* [OpenLDAP](http://www.openldap.org/)