我在Apache 2.2中遇到LDAP身份validation问题。 这里是httpd.conf的摘录
<Location /folder> AuthType Basic AuthName "Project" AuthBasicProvider ldap AuthLDAPBindDN "user@domain" AuthLDAPBindPassword "my_password" AuthLDAPURL "ldap://my_domain_controller/?samAccountName?sub?(objectClass=user)" Require valid-user </Location>
我在error.log中不断收到“用户失败的ldap_search_ext_s()”。 我尝试使用我引用的DN作为AuthLDAPBindDN,但结果是一样的。 可能是什么问题呢?
当我遇到这个问题时,显然是因为活动目录返回引用,并且openldap库不能应付。 两种不同的解决scheme为我工作; 我更喜欢第二个。 第一种解决方法:在/etc/openldap/ldap.conf中放行
REFERRALS no
那当然,假设你正在使用openldap库; 我没有最近的经验与其他任何人。
第二种解决scheme:Active Directory全局编目服务不会生成引用,因此将ldap指向端口而不是正常的端口(当然,您需要与全局编录服务器交谈;要查找它们的输出“dig -t srv _gc._tcp.domain”,其中“domain”是你的域名)。 全局编录的端口是3268,所以
AuthLDAPURL "ldap://my_domain_controller:3268/?samAccountName?sub?(objectClass=user)"