From aebb7b182f982dbd14f54abf10edc4a125bf027b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Sun, 1 Jan 2012 19:00:11 +0100 Subject: Added LDAP authentication (not working yet). --- sublab_project/settings.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sublab_project/settings.py') diff --git a/sublab_project/settings.py b/sublab_project/settings.py index b748f3e..d35e5c7 100644 --- a/sublab_project/settings.py +++ b/sublab_project/settings.py @@ -1,6 +1,10 @@ # Django settings for sublab_project project. import os +# from django_auth_ldap.config import LDAPSearch +# import ldap + + SITE_ROOT = os.path.realpath(os.path.dirname(__file__)) DEBUG = False TEMPLATE_DEBUG = DEBUG @@ -166,6 +170,25 @@ LOGGING = { } } +# AUTH_LDAP_SERVER_URI = 'ldap://taifun.local.sublab.org' +# AUTH_LDAP_BIND_DN = 'cn=djangotest,ou=users,dc=sublab,dc=org' +# AUTH_LDAP_BIND_PASSWORD = 'djangotest' +# AUTH_LDAP_USER_SEARCH = LDAPSearch('ou=users,dc=sublab,dc=org', +# ldap.SCOPE_SUBTREE, '(uid=%(user)s)') +AUTH_LDAP_USER_DN_TEMPLATE = 'uid=%(user)s,ou=users,dc=sublab,dc=org' +AUTH_LDAP_USER_ATTR_MAP = { + 'first_name': 'givenName', + 'last_name': 'sn', + 'email': 'mail' +} +AUTH_LDAP_ALWAYS_UPDATE_USER = True +AUTH_LDAP_START_TLS = True + +AUTHENTICATION_BACKENDS = ( + 'django_auth_ldap.backend.LDAPBackend', + 'django.contrib.auth.backends.ModelBackend', +) + try: from local_settings import * except ImportError: -- cgit v1.2.1