Python 通过ldap进行身份验证后,无法在django组中获取ldap用户组名称

Python 通过ldap进行身份验证后,无法在django组中获取ldap用户组名称,python,django,ldap,Python,Django,Ldap,我已经配置了免费的jumpcloud ldap服务来测试用户 身份验证和组信息。我可以在中看到ldap用户信息 django admin上的django用户,但无法将ldap组复制到 django集团 import ldap from django_auth_ldap.config import LDAPSearch, GroupOfNamesType, LDAPGroupQuery, PosixGroupType AUTH_LDAP_SERVER_URI = "ldap://lda

我已经配置了免费的jumpcloud ldap服务来测试用户 身份验证和组信息。我可以在中看到ldap用户信息 django admin上的django用户,但无法将ldap组复制到 django集团

import ldap
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType, LDAPGroupQuery, PosixGroupType

AUTH_LDAP_SERVER_URI = "ldap://ldap.jumpcloud.com:389"
AUTH_LDAP_BIND_DN = "uid=testuser,ou=Users,o=5f4536f3d939d05ab35b66ef,dc=jumpcloud,dc=com"
AUTH_LDAP_BIND_PASSWORD = "Admin@12345"
AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=Users,o=5f4536f3d939d05ab35b66ef,dc=jumpcloud,dc=com",
ldap.SCOPE_SUBTREE, "(uid=%(user)s)")


AUTH_LDAP_ALWAYS_UPDATE_USER = True
AUTH_LDAP_FIND_GROUP_PERMS = True
AUTH_LDAP_CACHE_GROUPS = True
AUTH_LDAP_MIRROR_GROUPS = True

IS_SUPER_USER_FLAG = (
LDAPGroupQuery("cn=Group1,ou=Users,o=5f4536f3d939d05ab35b66ef,dc=jumpcloud,dc=com")
)

IS_STAFF_FLAG = (
LDAPGroupQuery("cn=Grroup2,ou=Users,o=5f4536f3d939d05ab35b66ef,dc=jumpcloud,dc=com")
)

AUTH_LDAP_USER_FLAGS_BY_GROUP = {
'is_active': IS_SUPER_USER_FLAG,
'is_staff': IS_SUPER_USER_FLAG ,
'is_superuser': IS_SUPER_USER_FLAG,
}

AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr='cn')
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
'ou=groups,dc=jumpcloud,dc=com,o=5f4536f3d939d05ab35b66ef',
ldap.SCOPE_SUBTREE,
'(objectClass=top)',
)

# Tried also with (objectClass=groupOfNames)

#Also 

#AUTH_LDAP_GROUP_TYPE = PosixGroupType(name_attr='cn')
#AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
#    'ou=groups,dc=jumpcloud,dc=com',
#    ldap.SCOPE_SUBTREE,
#    '(objectClass=posixGroup)',)