Skip to content

Commit

Permalink
Fix generic OIDC: return the correct user_id field (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Apr 19, 2022
1 parent 7d19c85 commit dfdde51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fence/resources/openid/idp_oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ def get_user_id(self, code):
if claims.get(user_id_field):
if user_id_field == "email" and not claims.get("email_verified"):
return {"error": "Email is not verified"}
return {"sub": claims[user_id_field]}
return {user_id_field: claims[user_id_field]}
else:
self.logger.exception(
f"Can't get {user_id_field} from claims: {claims}"
)
return {"error": f"Can't get {user_id_field} from claims"}

except Exception as e:
Expand Down

0 comments on commit dfdde51

Please sign in to comment.