我正在尝试将 ldap 身份验证集成到我的 Zend 项目之一。
我尝试在 Windows 7 上使用 ApacheDS 和 Windows ldap。我可以连接到两个 ldap 服务器,但身份验证没有成功。
我的开发环境是:
- Windows 7的
- IIS 服务器
- PHP 和 MSSQL
- ApacheDS 或 Windows LDAP
当我使用 ApacheDS 时,我收到以下错误:
object(Zend_Auth_Result)#122 (3) {
["_identity":protected] => string(9) "mshakeel1"
["_messages":protected] => array(4) {
[0] => string(28) "Account not found: mshakeel1"
[1] => string(71) "0x20: No object found for: (&(objectClass=posixAccount)(uid=mshakeel1))"
[2] => string(188) "host=localhost,accountDomainName=foo.net,accountDomainNameShort=FOO,accountCanonicalForm=3,username=uid=admin,ou=system,password=*****,baseDn=ou=users,ou=system,bindRequiresDn=1,port=10389"
[3] => string(104) "mshakeel1 authentication failed: 0x20: No object found for: (&(objectClass=posixAccount)(uid=mshakeel1))"
}
}
对于 ApacheDS,我的 application.ini 如下:
ldap.server.host = localhost
ldap.server.accountDomainName = foo.net
ldap.server.accountDomainNameShort = FOO
ldap.server.accountCanonicalForm = 3
ldap.server.username = "uid=admin,ou=system"
ldap.server.password = 'secret'
ldap.server.baseDn = "ou=users,ou=system"
ldap.server.bindRequiresDn = true
ldap.server.port = 10389
当我使用 Windows LDAP 时,我收到以下错误:
object(Zend_Auth_Result)#122 (3) {
["_code":protected] => int(-3)
["_identity":protected] => string(9) "mshakeel1"
["_messages":protected] => array(4) {
[0] => string(19) "Invalid credentials"
[1] => string(129) "0x31 (Invalid credentials; 8009030C: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 2030, v1db0): W\mshakeel1"
[2] => string(139) "host=ABC-PC-SH,useStartTls=,accountDomainName=w.net,accountDomainNameShort=W,accountCanonicalForm=3,baseDn=CN=Employees,DC=ABC,DC=SHGroup"
[3] => string(162) "mshakeel1 authentication failed: 0x31 (Invalid credentials; 8009030C: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 2030, v1db0): W\mshakeel1"
}
对于 Windows LDAP,我的 application.ini 如下:
ldap.server.host = ABC-PC-SH
ldap.server.useStartTls = false
ldap.server.accountDomainName = w.net
ldap.server.accountDomainNameShort = W
ldap.server.accountCanonicalForm = 3
ldap.server.baseDn = "CN=Employees,DC=ABC,DC=SHGroup"
任何人都可以给我一个提示来解决这个问题吗?谢谢。
编辑:想添加更多信息。我的 ApacheDS 结构如下所示。
而我的windows轻量级AD服务如下图。