README.md in devise_ldap_authenticatable-0.8.6 vs README.md in devise_ldap_authenticatable-0.8.7
- old
+ new
@@ -1,11 +1,11 @@
Devise LDAP Authenticatable
===========================
-[![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)
+[![Gem Version](https://badge.fury.io/rb/devise_ldap_authenticatable.svg)](http://badge.fury.io/rb/devise_ldap_authenticatable)
+[![Code Climate](https://codeclimate.com/github/cschiewek/devise_ldap_authenticatable.svg)](https://codeclimate.com/github/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.
@@ -23,17 +23,19 @@
Usage
-----
In the Gemfile for your application:
- gem "devise_ldap_authenticatable"
-
+```ruby
+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"
+```ruby
+gem "devise_ldap_authenticatable", :git => "git://github.com/cschiewek/devise_ldap_authenticatable.git"
+```
-
Setup
-----
Run the rails generators for devise (please check the [devise](http://github.com/plataformatec/devise) documents for further instructions)
rails generate devise:install
@@ -59,13 +61,15 @@
-------------
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 you have to simply define `ldap_before_save` method:
- def ldap_before_save
- self.email = Devise::LDAP::Adapter.get_ldap_param(self.username,"mail").first
- end
+```ruby
+def ldap_before_save
+ self.email = Devise::LDAP::Adapter.get_ldap_param(self.username,"mail").first
+end
+```
Configuration
-------------
In initializer `config/initializers/devise.rb` :
@@ -97,10 +101,10 @@
* `ldap_auth_password_build` _(default: `Proc.new() {|new_password| Net::LDAP::Password.generate(:sha, new_password) }`)_
* Optionally you can define a proc to create custom password encrption when user reset password
Troubleshooting
--------------
-**Using a "username" instead of an "email":** The field that is used for logins is the first key that's configured in the `config/initializers/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. Also, this [documentation](https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-sign-in-using-their-username-or-email-address) from Devise can very helpful.
+**Using a "username" instead of an "email":** The field that is used for logins is the first key that's configured in the `config/initializers/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. Also, this [documentation](https://github.com/plataformatec/devise/wiki/How-To%3a-Allow-users-to-sign-in-using-their-username-or-email-address) from Devise can be very helpful.
**SSL certificate invalid:** If you're using a test LDAP server running a self-signed SSL certificate, make sure the appropriate root certificate is installed on your system. Alternately, you may temporarily disable certificate checking for SSL by modifying your system LDAP configuration (e.g., `/etc/openldap/ldap.conf` or `/etc/ldap/ldap.conf`) to read `TLS_REQCERT never`.
Discussion Group
------------