From cc9010b975a99e75c32a9ee17f258d19dda33bbd Mon Sep 17 00:00:00 2001 From: "Andrey N. Petrov" Date: Fri, 30 Mar 2018 16:39:12 +0300 Subject: [PATCH] Change to uid. --- configuration/ldap_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration/ldap_config.py b/configuration/ldap_config.py index 3ab1bf9..5280438 100644 --- a/configuration/ldap_config.py +++ b/configuration/ldap_config.py @@ -22,7 +22,7 @@ LDAP_IGNORE_CERT_ERRORS = True AUTH_LDAP_USER_SEARCH = LDAPSearch(os.environ.get('AUTH_LDAP_USER_SEARCH_BASEDN', ''), ldap.SCOPE_SUBTREE, - "(sAMAccountName=%(user)s)") + "(uid=%(user)s)") # This search ought to return all groups to which the user belongs. django_auth_ldap uses this to determine group # heirarchy. @@ -53,3 +53,5 @@ AUTH_LDAP_USER_ATTR_MAP = { "last_name": os.environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'), "email": os.environ.get('AUTH_LDAP_ATTR_MAIL', 'mail') } + +AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,%s" % os.environ.get('AUTH_LDAP_USER_SEARCH_BASEDN')