2013-07-10 54 views
6

首次登錄並註冊到數據庫中。雖然現在我遇到了我無法再登錄的問題。FOS和Fr3d ldap與symfony2.1捆綁

"symfony/symfony": "2.1.*" 
"fr3d/ldap-bundle": "2.0.*@dev" 

我也有類似的issies,但如果 「bindRequiresDn:真正的」 我得到了我的日誌:

[2013年7月10日11時37分18秒] ldap_driver.DEBUG:的ldap_bind(尼基塔,* *)[] []

[2013年7月10日11點37分十八秒] ldap_driver.DEBUG:爲0x1:無法檢索DN帳戶:尼基塔[裝訂方式需要用戶名DN格式] [ ] []

無法登錄。

但如果我改變:

... /供應商/ fr3d/LDAP束/ FR3D/LdapBundle /驅動器/ ZendLdapDriver.php

if ($user instanceof LdapUserInterface && $user->getDn()) { 
    $bind_rdn = $user->getDn(); 
} else { 
    $bind_rdn = $user->getUsername(); 
} 

if ($user instanceof LdapUserInterface) { 
    $bind_rdn = $user->getDn(); 
} else { 
    $bind_rdn = $user->getUsername(); 
} 

所有的作品都很好。

我的配置

fr3d_ldap: 
    driver: 
     host:      "%ldap_host%" 
     port:      "%ldap_port%" 
     username:     "%ldap_username%" 
     password:     "%ldap_password%" 
     baseDn:      ou=hello, dc=h, dc=i, dc=ru 
     bindRequiresDn:  true 
     accountFilterFormat: (&(samaccountname=%s)) 

    user: 
     baseDn: ou=hello, dc=h, dc=i, dc=ru 
     filter: (&(objectClass=user)) 
     attributes: 
      - { ldap_attr: samaccountname, user_method: setUsername } 
+1

問題在哪裏? – PokeRwOw

回答

0

我最初使用FR3DLdapBundle和註銷,然後嘗試登錄第二個時間後,當有問題。

您可能希望通過我的博客文章在這裏閱讀: Symfony AD Integration

我不知道,如果你已經有了答案或者得到了這個工作,但希望這可以幫助別人了!