Skip to content

Commit 215ebfe

Browse files
Fix LDAP Get Name to use Common Name
1 parent 91e08b9 commit 215ebfe

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

conditional/util/ldap.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,4 @@ def ldap_set_inactive(username):
240240

241241
@lru_cache(maxsize=1024)
242242
def ldap_get_name(username):
243-
first = __ldap_get_field__(username, 'givenName')
244-
if first is None:
245-
first = ""
246-
else:
247-
first = first.decode('utf-8')
248-
last = __ldap_get_field__(username, 'sn')
249-
if last is None:
250-
last = ""
251-
else:
252-
last = last.decode('utf-8')
253-
return "{first} {last}".format(first=first, last=last)
243+
return __ldap_get_field__(username, 'cn').decode('utf-8')

0 commit comments

Comments
 (0)