FOS and Fr3d ldap bundle with symfony2.1

Log in and register in the database. Although now I have a problem that I can’t log in a second time.

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

I saw similar results, but if "bindRequiresDn: true" I get in my logs:

[2013-07-10 11:37:18] ldap_driver.DEBUG: ldap_bind (Nikita, **) [] []

[2013-07-10 11:37:18] ldap_driver.DEBUG: 0x1: Failed to get the DN for the account: Nikita [binding requires a username in the form of DN] [] []

and cannot enter.

But if I change:

... / seller / Fr3d / LDAP bundle / Fr3d / LdapBundle / Driver / ZendLdapDriver.php

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

about

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

everything works well.

My configuration

  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 } 
+6
source share
1 answer

I had problems when using FR3DLdapBundle for the first time and after logging out, and then trying to log in a second time.

You can read my blog article: Symfony AD Integration

I'm not sure if you already have an answer or if it works, but hopefully this helps someone else!

0
source

Source: https://habr.com/ru/post/949114/


All Articles