diff --git a/auth_oauth_microsoft/models/res_users.py b/auth_oauth_microsoft/models/res_users.py index 8e11a49f..d470c6dd 100644 --- a/auth_oauth_microsoft/models/res_users.py +++ b/auth_oauth_microsoft/models/res_users.py @@ -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