2

我进入我的登录页面,提交我的凭据,然后我被重定向说我的凭据错误。我的日志记录甚至似乎都不起作用,我假设 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",
    }
4

0 回答 0