Merge pull request #3269 from sirferl/AD-problem

LDAP: error decoding CN when using Active Directory
This commit is contained in:
Hossein Shafagh 2020-11-25 13:20:01 -08:00 committed by GitHub
commit 7b5d6d3db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -211,7 +211,7 @@ class LdapPrincipal:
for group in lgroups: for group in lgroups:
(dn, values) = group (dn, values) = group
if type(values) == dict: if type(values) == dict:
self.ldap_groups.append(values["cn"][0].decode("ascii")) self.ldap_groups.append(values["cn"][0].decode("utf-8"))
else: else:
lgroups = self.ldap_client.search_s( lgroups = self.ldap_client.search_s(
self.ldap_base_dn, ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs self.ldap_base_dn, ldap.SCOPE_SUBTREE, ldap_filter, self.ldap_attrs