Closed vbeauvivre closed 8 years ago
About the changes on LegacyHydrator
, this class is legacy and deprecated so I don't have plans to maintenance that class.
About the LdapException thrown I would like more details about what DN was used and tests. I suspect may be an issue in your implementation.
To reproduce the situation : -I installed a LDAP server with this DN : dc=ldap,dc=mydomain,dc=fr -I created a samba user with https://sourceforge.net/projects/phpldapadmin/ -I installed symfony + fos_user_bundle + FR3DLdapBundle -I configure it all, with only fos_user_bundle provider (in security.yml) only. Everything is ok : I connect with user in DB. -I configure it all, with only fr3d_ldapbundle provider (in security.yml) only. Everything is ok : I connect with LDAP user account. -I configure it all, with only a chain provider that includes LDAP (first), then FOS_USER providers (in security.yml). Everything is ok with LDAP account : I connect succefully and get fully authentified. But I cannot connect with my fos_user in db. In this case it throws me a Zend\Ldap\Exception\LdapException with message «LDAP_INVALID_DN_SYNTAX». Maybe because the $user->getDn() returns an empty string.
null
if DN is unknownOk, that fix it !
But I do not understand about the LegacyHydrator. Should this class not be used ? Does that mean implementation need to overide fr3d_ldap.user_hydrator.default service ? or there is another way to define hyrator ? Thanks
The problem is there is no interfaces for setters, hydrators offer a bridge so you can set the data from LDAP in the user object.
LegacyHydrator has an opiniated way of use many setters and reduce the complexity of migrate from previous versions of this bundle.
I made those changes through class overiding in my application successfully, so I just wante to share this work.
Thanks for sharing this bundle.