cschiewek / devise_ldap_authenticatable

Devise Module for LDAP
MIT License
593 stars 359 forks source link

Net::LDAP Search works but login fails #203

Closed imkarthikk closed 8 years ago

imkarthikk commented 9 years ago

I've been stuck at this for about 15 hours. It's on the verge of throwing my laptop. The weird issue is, the LDAP search/listing works PERFECTLY. It binds with the username and password I've given and shows all the users who have that attribute (eg, CN, UID, sAMAaccountName). However when I try to login, it shows:

screen shot 2015-05-01 at 4 00 47 pm

This is how I listed all the users,

screen shot 2015-05-01 at 4 01 08 pm

ANY help would be immensely appreciated!

acurley commented 9 years ago

Have you changed the default authentication key in config/initializers/devise.rb? It should look like this:

Devise.setup do |config|
....
config.authentication_keys = [:username]
....
end

In your screen shots it looks like you are using a username but the default for this gem is :email.