Skip to content

Commit

Permalink
Merge pull request #711 from terbolous/azure_oauth
Browse files Browse the repository at this point in the history
Azure oauth fixes
  • Loading branch information
ngoduykhanh committed May 1, 2020
2 parents 5bd8990 + b03cbde commit 978c0b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions powerdnsadmin/routes/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def login():
return redirect(url_for('index.index'))

if 'azure_token' in session:
azure_info = azure.get('me?$select=displayName,givenName,id,mail,surname,userPrincipalName,preferredName').text
azure_info = azure.get('me?$select=displayName,givenName,id,mail,surname,userPrincipalName').text
current_app.logger.info('Azure login returned: '+azure_info)
me = json.loads(azure_info)

Expand All @@ -218,8 +218,8 @@ def login():
azure_username = me["userPrincipalName"]
azure_givenname = me["givenName"]
azure_familyname = me["surname"]
if "email" in me:
azure_email = me["email"]
if "mail" in me:
azure_email = me["mail"]
else:
azure_email = ""
if not azure_email:
Expand Down

0 comments on commit 978c0b6

Please sign in to comment.