From 916dd713e3b7d18a31379f4922aa8b37ec328554 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sat, 7 Sep 2013 16:14:43 -0400 Subject: AC-156 Added code and tests to support LDAP authentication (no organization or team mapping yet). --- config/deb/settings.py | 28 ++++++++++++++++++++++++++++ config/rpm/settings.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) (limited to 'config') diff --git a/config/deb/settings.py b/config/deb/settings.py index 50ac050710..015d074de3 100644 --- a/config/deb/settings.py +++ b/config/deb/settings.py @@ -54,3 +54,31 @@ EMAIL_PORT = 25 EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' EMAIL_USE_TLS = False + +# LDAP connection and authentication settings. Refer to django-auth-ldap docs: +# http://pythonhosted.org/django-auth-ldap/authentication.html + +AUTH_LDAP_SERVER_URI = '' +AUTH_LDAP_BIND_DN = '' +AUTH_LDAP_BIND_PASSWORD = '' +AUTH_LDAP_START_TLS = False + +#import ldap +#from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion + +# LDAP search query to find users. +#AUTH_LDAP_USER_SEARCH = LDAPSearch( +# 'OU=Users,DC=example,DC=com', +# ldap.SCOPE_SUBTREE, +# '(sAMAccountName=%(user)s)', +#) + +# Alternative to user search. +#AUTH_LDAP_USER_DN_TEMPLATE = 'sAMAccountName=%(user)s,OU=Users,DC=example,DC=com' + +# Mapping of LDAP attributes to user attributes. +#AUTH_LDAP_USER_ATTR_MAP = { +# 'first_name': 'givenName', +# 'last_name': 'sn', +# 'email': 'mail', +#} diff --git a/config/rpm/settings.py b/config/rpm/settings.py index 50ac050710..015d074de3 100644 --- a/config/rpm/settings.py +++ b/config/rpm/settings.py @@ -54,3 +54,31 @@ EMAIL_PORT = 25 EMAIL_HOST_USER = '' EMAIL_HOST_PASSWORD = '' EMAIL_USE_TLS = False + +# LDAP connection and authentication settings. Refer to django-auth-ldap docs: +# http://pythonhosted.org/django-auth-ldap/authentication.html + +AUTH_LDAP_SERVER_URI = '' +AUTH_LDAP_BIND_DN = '' +AUTH_LDAP_BIND_PASSWORD = '' +AUTH_LDAP_START_TLS = False + +#import ldap +#from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion + +# LDAP search query to find users. +#AUTH_LDAP_USER_SEARCH = LDAPSearch( +# 'OU=Users,DC=example,DC=com', +# ldap.SCOPE_SUBTREE, +# '(sAMAccountName=%(user)s)', +#) + +# Alternative to user search. +#AUTH_LDAP_USER_DN_TEMPLATE = 'sAMAccountName=%(user)s,OU=Users,DC=example,DC=com' + +# Mapping of LDAP attributes to user attributes. +#AUTH_LDAP_USER_ATTR_MAP = { +# 'first_name': 'givenName', +# 'last_name': 'sn', +# 'email': 'mail', +#} -- cgit v1.2.3