Closed
Description
When authenticating a user using the LDAP security component, username entered by the user is used to build the User
instance.
In case of a case-insensitive authentication (which is the default behavior : https://stackoverflow.com/questions/29897684/is-ldap-dn-case-insensitive), the final User
username can be wrong (for instance, USERNAME
instead of UserName
).
To avoid this issue, I'm using the cn
attribute of the Ldap\Entry
instead, so I'm getting the well-spelled username. To apply a more generic solution, I think we should store the $uidKey
as an attribute in the LdapUserProvider
and use it to retrieve the username using the Entry
($entry->getAttribute($this->uidKey)
).
I can create a pull request if you want.
Thx !