LDAP无法执行经过身份validation的绑定 – Windows Server 2008 R2使用PHP / Apache

我遇到问题执行一个validation绑定对服务器。 这些问题似乎没有在代码中,但也许是一个服务器问题。

就这样你知道;

  • LDAP在Apache / PHP中启用
  • 我以[email protected]身份进行连接
  • 域控制器有LDAP运行,并在防火墙(Windows Server 2008 R2)中的条目问题可能在这里,这是作为一个DC设置,并在默认情况下运行LDAP。 我没有在LDAP上进行特殊configuration
  • 我可以执行一个匿名绑定,但不是一个authentication的

我可以用这个脚本匿名绑定;

$ldapconn = ldap_connect("machinename.domain.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding anonymously $ldapbind = ldap_bind($ldapconn); if ($ldapbind) { echo "LDAP bind anonymous successful..."; } else { echo "LDAP bind anonymous failed..."; } } 

但是,当我尝试使用此脚本进行身份validation的绑定时,它将失败。

 // Authenticated Bind $ldaprdn = '[email protected]'; // ldap rdn or dn $ldappass = 'password'; // associated password // connect to ldap server $ldapconn = ldap_connect("machinename.domain.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; } } 

我哪里错了?

好,经过多次调查,我已经打开错误信息使用ldap_errno()ldap_error()并发现它带回错误“强(呃)authentication所需”已经发现了两种可能的解决scheme;

调整组策略设置

  • 协商签名(networking安全:LDAP客户端签名要求)
  • 没有签名要求(域控制器:LDAP服务器签名要求)

  • 结果:pipe理成功绑定,当我不正确地input用户名或密码,并按预期抛出“无效的凭据”。

通过SSL启用LDAP(LDAPS)