Skip to content

Commit

Permalink
TA#41437 Microsoft SSO: Use sub if email not given (#95)
Browse files Browse the repository at this point in the history
When a user logs in with a personnal accounts, the email field is not given when accessing the user-info endpoint.
  • Loading branch information
ddufresne authored Dec 15, 2021
1 parent d85ad1d commit 5719195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion auth_oauth_microsoft/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _auth_oauth_validate(self, provider, access_token):

provider_obj = self.env["auth.oauth.provider"].browse(provider)
if _is_microsoft_endpoint(provider_obj.auth_endpoint):
validation["user_id"] = validation["email"]
validation["user_id"] = validation.get("email") or validation["sub"]

return validation

Expand Down

0 comments on commit 5719195

Please sign in to comment.