Change to uid.

This commit is contained in:
Andrey N. Petrov 2018-03-30 16:39:12 +03:00
parent 8bfc4b61a2
commit cc9010b975

View file

@ -22,7 +22,7 @@ LDAP_IGNORE_CERT_ERRORS = True
AUTH_LDAP_USER_SEARCH = LDAPSearch(os.environ.get('AUTH_LDAP_USER_SEARCH_BASEDN', ''), AUTH_LDAP_USER_SEARCH = LDAPSearch(os.environ.get('AUTH_LDAP_USER_SEARCH_BASEDN', ''),
ldap.SCOPE_SUBTREE, 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 # This search ought to return all groups to which the user belongs. django_auth_ldap uses this to determine group
# heirarchy. # heirarchy.
@ -53,3 +53,5 @@ AUTH_LDAP_USER_ATTR_MAP = {
"last_name": os.environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'), "last_name": os.environ.get('AUTH_LDAP_ATTR_LASTNAME', 'sn'),
"email": os.environ.get('AUTH_LDAP_ATTR_MAIL', 'mail') "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')