Skip to content

Commit

Permalink
Merge cbf1254 into 9d96c91
Browse files Browse the repository at this point in the history
  • Loading branch information
mfshao committed Nov 27, 2019
2 parents 9d96c91 + cbf1254 commit 0f63509
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fence/blueprints/login/synapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):

def post_login(self, user, token_result):
user.id_from_idp = token_result["sub"]
user.email = token_result["email_verified"]
user.email = token_result["email"]
user.display_name = "{given_name} {family_name}".format(**token_result)
info = {}
if user.additional_info is not None:
Expand Down
5 changes: 2 additions & 3 deletions fence/resources/openid/synapse_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ class SynapseOauth2Client(Oauth2ClientBase):
"""

REQUIRED_CLAIMS = {"given_name", "family_name", "email", "email_verified"}
REQUIRED_CLAIMS = {"given_name", "family_name", "email", "email_verified", "userid"}
OPTIONAL_CLAIMS = {
# "company",
# "userid",
# "orcid",
# "is_certified",
# "is_validated",
Expand Down Expand Up @@ -125,7 +124,7 @@ def get_user_id(self, code):
return dict(error="Required claim {} not found".format(claim))
else:
rv[claim] = value
rv["fence_username"] = rv["email"] + " (via Synapse)"
rv["fence_username"] = rv["userid"] + " (via Synapse)"
return rv
except Exception as e:
self.logger.exception("Can't get user info")
Expand Down

0 comments on commit 0f63509

Please sign in to comment.