Skip to content

archery v1.10.0配置ldap集成修改.env文件不生效 #2480

Answered by charlesqing
charlesqing asked this question in Q&A
Discussion options

You must be logged in to vote

问题解决了,archery v.1.10.0对接windows AD的配置参数和ldap有点差别,正确的参数如下:

LDAP

ENABLE_LDAP = True
if ENABLE_LDAP:
import ldap
from django_auth_ldap.config import LDAPSearch

AUTHENTICATION_BACKENDS = (
    "django_auth_ldap.backend.LDAPBackend",  # 配置为先使用LDAP认证,如通过认证则不再使用后面的认证方式
    "django.contrib.auth.backends.ModelBackend",  # django系统中手动创建的用户也可使用,优先级靠后。注意这2行的顺序
)

AUTH_LDAP_SERVER_URI = 'ldap://xxx:389'
AUTH_LDAP_BIND_DN = 'CN=xxx,CN=xxx,DC=xxx,DC=xxx'
AUTH_LDAP_BIND_PASSWORD = 'xxx'
AUTH_LDAP_USER_SEARCH = LDAPSearch('OU=xxx,DC=xxx,DC=xxx',ldap.SCOPE_SUBTREE, '(sAMAccountName=%(user)s)')
AUTH_LDAP_ALWAYS_UPDATE_USER = True
AUTH_LDAP_USER_ATTR_MAP = {
'username': 'sAMAccountName',
'display': 'displayn…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by LeoQuote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant