我有一段时间让omniauth-ldap能够正常使用我们的AD服务器,我相信这是因为我们的用户名有我们的域名。Omniauth-ldap无效的凭据
这将成功地连接到我们的LDAP服务器:
ldapsearch -h ldap.ourdomain.com -b "dc=ourdomain,dc=int" -D "OURDOMAIN\username" -w <password> '(sAMAccountName=username)'
但是,在OmniAuth这些设置只会导致 “无效凭证”
Padrino.use OmniAuth::Strategies::LDAP,
:host => "ldap.ourdomain.com",
:base => "dc=OURDOMAIN,dc=INT",
:uid => "sAMAccountName",
:bind_dn => 'OURDOMAIN\%{username}',
# This is hard coded for now, but I need it to be the value entered by the user
:password => "mypassword"
UPDATE
这方面的工作此外,我发现omniauth-ldap会将bind方法设置为:anonymous,如果:bind_dn和:password未设置。
但是,如果设置的值为为,则不会插入用户名,也不会提供用户输入的密码。
我需要的是
:bind_dn => 'OURDOMAIN\<user entered username>',
:password => <user entered password>
但密码和输入的用户名只提供给连接,如果你硬编码他们。