我使用authnz_ldap_module进行Apache2身份validation时出现问题,以便从Active Directoryvalidation用户身份。 我的Apache版本是2.2.16-6+squeeze10 。
这里是我试图使用没有运气(准确地说是许多组合之一)的configuration:
AuthzLDAPAuthoritative off AuthBasicProvider ldap AuthType Basic AuthName "Active Directory" AuthLDAPURL "ldap://server1.my.company.tld:3268 server2.my.company.tld:3268/dc=my,dc=company,dc=tld?sAMAccountName?sub" AuthLDAPBindDN "uid=my_user,dc=my,dc=company,dc=tld" AuthLDAPBindPassword "mypassword" Require valid-user
我在Apache的error.log获得以下条目:
[debug] mod_authnz_ldap.c(379): [client some_ip_here] [12391] auth_ldap authenticate: using URL ldap://server1.my.company.tld:3268 server2.my.company.tld:3268/dc=my,dc=company,dc=tld?sAMAccountName?sub [info] [client some_ip_here] [12391] auth_ldap authenticate: user my_user authentication failed; URI / [LDAP: ldap_simple_bind_s() failed][Invalid credentials] [error] [client some_ip_here] user my_user: authentication failure for "/": Password Mismatch
当然我每次input正确的密码,我已经在AD被阻止了大约百次,至今没有发生过单次。
我无法validation,我可以连接到我的AD控制器,因为当我尝试:
ldapsearch -h server1.my.company.tld -p 3268 -D "dc=my,dc=company,dc=tld"
我得到以下错误:
text: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1
我完全不知道如何绑定到ldapsearch和手动目前没有帮助我。
我在做什么Apache2configuration错误,我怎么能绑定与ldapsearch ?
如果需要,我会提供更多的信息。
问题最严重的情况是AuthLDAPBindDN,它的语法必须是“[email protected]”,而不是语法“domain \ user”,既不是“user”也不是“uid = my_user,dc = my,dc = company” ,DC = TLD”。 下面是适合我的工作方式,我在这里提供了解决scheme。
AuthzLDAPAuthoritative off AuthBasicProvider ldap AuthType Basic AuthName "Active Directory" AuthLDAPURL "ldap://server1.my.company.tld:3268 server2.my.company.tld:3268/DC=ad,DC=upos,DC=pl?sAMAccountName?sub?(objectClass=*)" AuthLDAPBindDN "[email protected]" AuthLDAPBindPassword "some_random_password" Require valid-user
提供答案花了很长时间,我很抱歉。
你必须告诉ldapsearch你绑定的是谁,按照ldapsearch –help,使用-U开关并给它一个用户名…
ldapsearch -h server1.my.company.tld -p 3268 -D "dc=my,dc=company,dc=tld" -U <username>