Lucterios2 / django_auth_ldap3_ad

Simple LDAP/AD auth module for django
https://pypi.python.org/pypi/django-auth-ldap3-ad
GNU General Public License v3.0
45 stars 25 forks source link

Case sensitive comparison for LDAP_GROUP_MAP #35

Open coredmp95 opened 3 years ago

coredmp95 commented 3 years ago

Hello,

First thanks a lot for this great module, vert usefull.

I juste face some issue that take le some Time to correct.

The LDAP search is case insensitive, and the comparison which is uses in the LDAP_GROUP_MAP is not.

So there is case where the group will be find in the LDAP and user not added in the Django group.

Maybe the comparison should uses a .lower() somewhere : if resp['dn'].lower() == settings.LDAP_GROUPS_MAP[grp].lower()

For exemple .