DirectoryTree / LdapRecord

A fully-featured LDAP framework.
https://ldaprecord.com
MIT License
502 stars 44 forks source link

[2.x] Case insensitive DN comparison #608

Closed bonroyage closed 1 year ago

bonroyage commented 1 year ago

Ported from #607


I noticed while I was making an authentication rule, that the validation would fail, even though I was sure that the DN was correctly given.

Turns out that providing a string wouldn't work while providing the same string within Group::findOrFail would work if the DN provided by the LDAP server has a different case, like cn=foo,dc=local,dc=com.

Works:

return $this->user->groups()->exists(
    Group::findOrFail('CN=foo,DC=local,DC=com')
);

Doesn't work:

return $this->user->groups()->exists(
    'CN=foo,DC=local,DC=com'
);
stevebauman commented 1 year ago

Thanks again @bonroyage! I’ll create a new release shortly.