etianen / django-python3-ldap

Django LDAP user authentication backend for Python 3.
BSD 3-Clause "New" or "Revised" License
412 stars 120 forks source link

Incorrect username comparison causes redundant rebind #256

Closed gagantrivedi closed 1 year ago

gagantrivedi commented 1 year ago

Firstly, thanks for the amazing work! Now, Here: https://github.com/etianen/django-python3-ldap/blob/master/django_python3_ldap/ldap.py#L214 settings.LDAP_AUTH_CONNECTION_USERNAME is never going to be equal to username since username here is formatted, but we format settings.LDAP_AUTH_CONNECTION_USERNAME after comparison resulting in a redundant rebind, unless I am missing something (which is entirely possible :) ) ?

etianen commented 1 year ago

You appear to be completely correct.

I'd take a bugfix PR for this, if you feel up to it? :pray:

etianen commented 1 year ago

I see you have in #257

etianen commented 1 year ago

I'll make a new release with the bugfix today