diff options
Diffstat (limited to 'okupy/common/auth.py')
-rw-r--r-- | okupy/common/auth.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/okupy/common/auth.py b/okupy/common/auth.py index 08d2fe6..9dcf554 100644 --- a/okupy/common/auth.py +++ b/okupy/common/auth.py @@ -23,6 +23,11 @@ class LDAPAuthBackend(ModelBackend): """ def authenticate(self, request, username, password): + # LDAP is case- and whitespace-insensitive + # we do normalization to avoid duplicate django db entries + # and help mockldap + username = username.lower().strip() + try: bound_ldapuser = get_bound_ldapuser( request=request, |