# LDAP authentication with Devise
* If LDAP authentication is by username (not email), add to Devise the possibility to login with username:
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign_in-using-their-username-or-email-address
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-with-something-other-than-their-email-address
* Add to Gemfile the gem net-ldap:
https://rubygems.org/gems/net-ldap/versions/0.15.0
https://github.com/ruby-ldap/ruby-net-ldap
<code>
gem 'net-ldap', '~> 0.15.0'
</code>
* Follow the instructions on:
https://github.com/plataformatec/devise/wiki/How-To:-Authenticate-via-LDAP
* In <code>config/initializers/ldap_authenticatable.rb</code> replace:
[YOUR LDAP HOSTNAME]
[YOUR LDAP HOSTNAME PORT] # 389 default port