Allow user filter for LDAP to be configure

This commit is contained in:
Miguel Perez 2017-04-03 21:13:19 -04:00
parent 6596bcf0ec
commit 283751ea24
4 changed files with 5 additions and 1 deletions

View File

@ -8,8 +8,9 @@ AUTH_LDAP_SERVER_URI = os.environ.get('AUTH_LDAP_SERVER_URI', 'ldap://ldap.examp
AUTH_LDAP_BIND_DN = os.environ.get('AUTH_LDAP_BIND_DN', 'cn=Manager,dc=example,dc=com')
AUTH_LDAP_BIND_PASSWORD = os.environ.get('AUTH_LDAP_BIND_PASSWORD', '')
AUTH_LDAP_USER_FILTER = os.environ.get('AUTH_LDAP_USER_FILTER', '(uid=%(user)s)')
AUTH_LDAP_USER_SEARCH = LDAPSearch(os.environ.get('AUTH_LDAP_USER_SEARCH', 'ou=user,dc=example,dc=com'),
ldap.SCOPE_SUBTREE, '(uid=%(user)s)')
ldap.SCOPE_SUBTREE, AUTH_LDAP_USER_FILTER)
# Populate the Django user from the LDAP directory.
AUTH_LDAP_USER_ATTR_MAP = {

View File

@ -70,4 +70,5 @@ AUTH_LDAP=true
AUTH_LDAP_SERVER_URI=ldap://ldap.example.com
AUTH_LDAP_BIND_DN="cn=Manager,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD=""
AUTH_LDAP_USER_FILTER="(uid=%(user)s)"
AUTH_LDAP_USER_SEARCH="ou=People,dc=example,dc=com"

View File

@ -64,4 +64,5 @@ AUTH_LDAP=true
AUTH_LDAP_SERVER_URI=ldap://ldap.example.com
AUTH_LDAP_BIND_DN="cn=Manager,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD=""
AUTH_LDAP_USER_FILTER="(uid=%(user)s)"
AUTH_LDAP_USER_SEARCH="ou=People,dc=example,dc=com"

View File

@ -68,4 +68,5 @@ AUTH_LDAP=true
AUTH_LDAP_SERVER_URI=ldap://ldap.example.com
AUTH_LDAP_BIND_DN="cn=Manager,dc=example,dc=com"
AUTH_LDAP_BIND_PASSWORD=""
AUTH_LDAP_USER_FILTER="(uid=%(user)s)"
AUTH_LDAP_USER_SEARCH="ou=People,dc=example,dc=com"