簡體   English   中英

Zend:ApacheDS和Windows ldap身份驗證問題

[英]Zend: ApacheDS and Windows ldap authentication issues

我正在嘗試將ldap身份驗證集成到我的Zend項目之一。

我嘗試將ApacheDS和Windows ldap用於Windows7。我可以連接到兩個ldap服務器,但是身份驗證未成功。

我的開發環境是:

  • Windows 7的
  • IIS服務器
  • PHP和MSSQL
  • ApacheDS或Windows LDAP

當我使用ApachDS時,出現以下錯誤:

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服務如下所示。

在此處輸入圖片說明

以下是您將項目連接到兩個不同LDAP服務器時提到的兩個錯誤的原因:

  1. 使用ApacheDS服務器:您的項目正在使用對象類posixAccount查詢用戶條目(看看錯誤消息中提到的查詢:(&(objectClass = posixAccount)(uid = mshakeel1)))

為了解決這個問題,您需要有一個具有給定uid的對象,並且該對象是使用posixAccount對象類創建的。 我不確定它是否默認為ApacheDS支持的對象類。 如果不是,則需要將該對象類添加到ApacheDS。 您可以參考: http : //hasini-gunasinghe.blogspot.com/2011/02/how-to-introduce-custom-attributes-to.html

否則,您可以更改項目以使用ApacheDS中受支持的對象類來構造上述搜索查詢。 (用於創建用戶對象的默認對象類是inetOrgPerson),並確保搜索到的條目在ApacheDS服務器中。

  1. 對於Active Directory,從錯誤消息來看,似乎為用戶提供的憑據是錯誤的:““ mshakeel1”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM