Django-auth-ldap配置

时间:2013-08-26 18:36:53

标签: python django ldap django-auth-ldap

我进入登录页面,提交我的凭据,然后重定向,说我的凭据错误。我的日志记录似乎没有工作,我假设django-auth-ldap配置甚至没有正确设置。任何进一步的帮助将不胜感激。我的日志记录可能不正确,但我完全按照文档进行了操作。

谢谢!

import logging
logger = logging.getLogger('django_auth_ldap')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG) 


# LDAP Settings
AUTH_LDAP_START_TLS = True
# Required LDAP Settings
AUTH_LDAP_SERVER_URI = "ldap://xxxxx.xxx.xxx.xxx"

AUTH_LDAP_BIND_DN = ''
AUTH_LDAP_BIND_PASSWORD = ''                                    
AUTH_LDAP_USER_DN_TEMPLATE = "uid=%(user)s,ou=people,dc=xxx,dc=xxx,dc=xxx"
AUTH_LDAP_BASE_DN = "dc=xxx,dc=xxx,dc=xxx"
AUTH_LDAP_REQUIRE_GROUP = "cn=users,ou=groups,dc=xxx,dc=xxx,dc=xxx"
AUTH_LDAP_GROUP_TYPE = PosixGroupType(name_attr="cn")
AUTH_LDAP_VERSION = 3                                                            # LDAP version

# Optional
AUTH_LDAP_FIELD_USERAUTH = "uid"                     # The field from which the user authentication shall be done.
AUTH_LDAP_FIELD_AUTHUNIT = "people"                  # The organisational unit in which your users shall be found.
AUTH_LDAP_FIELD_USERNAME = "uid"                     # The field from which to draw the username (Default 'uid'). (Allows non-uid/non-dn custom fields to be used for login.)                     # Should django try the directory for the user's email ('mail')?
AUTH_LDAP_ATTR_MAP = {
    "username": "uid",
    "email": "mailRoutingAddress",
    }

0 个答案:

没有答案