Skip to content

Commit

Permalink
userPrincipalName should be mail attribute
Browse files Browse the repository at this point in the history
Our userprincipalnames do not match with mail attribute. TODO: Fix auth with other applications
  • Loading branch information
rinkp committed Dec 20, 2020
1 parent dc4de3a commit 492f15d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions syncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def sync():

ldap_results = ldap_connector.search_s(config['LDAP_BASE_DN'], ldap.SCOPE_SUBTREE,
config['LDAP_FILTER'],
['userPrincipalName', 'cn', 'userAccountControl'])
['mail', 'cn', 'userAccountControl'])

ldap_results = map(lambda x: (
x[1]['userPrincipalName'][0].decode(),
x[1]['mail'][0].decode(),
x[1]['cn'][0].decode(),
False if int(x[1]['userAccountControl'][0].decode()) & 0b10 else True), ldap_results)

Expand Down

0 comments on commit 492f15d

Please sign in to comment.