cschiewek / devise_ldap_authenticatable

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

Successfully matches but get 401 Unauthorized #207

Closed metmayhem closed 9 years ago

metmayhem commented 9 years ago

I'm trying to get authentication working against our Active Directory server. When I attempt to login, it searches and successfully finds my account but then fails to authenticate. The alert says "invalid email or password", however I know for a fact the password is good because I've tested it via irb using net-ldap. And the email must be good because it found the account using it. Is there something I'm missing?

image image

Here is my ldap.yml:

## Environment
default: &default
    host: adsrv
    port: 389
    attribute: mail
    base: ou=Employees,dc=XXXXXXXXX,dc=local
    admin_user: cn=XXXXXX,ou=Generic,ou=IT,ou=Employees,dc=XXXXXXXXX,dc=local
    admin_password: XXXXXXXX
    ssl: false

development:
    <<: *default

test:
    <<: *default

production:
    <<: *default

Environment OS: Fedora 20 64bit (3.19.5-100) Ruby: 2.0.0.p353 Rails 4.1.7 devise_ldap_authenticatable: 0.8.4 net-ldap: 0.5.1

bradleyprice commented 9 years ago

@metmayhem Have you set the ldap_create_user to true in the devise initializer? If not, you will have to already have the records created.

metmayhem commented 9 years ago

That did it. Thank you. I saw that setting but thought it was for creating a user on the ldap server rather than on the local database.