Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix integrityerror during azure auth #750

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Removed OpenStackDevOpenId backend
- Updated `user_data` method in `StripeOAuth2` to return `email` in `get_user_details`
- Removes fixed version of `lxml`

- Updated Azure to fix IntegrityError at /social-auth/complete/azuread-oauth2/

## [4.3.0](https://github.com/python-social-auth/social-core/releases/tag/4.3.0) - 2022-06-13

Expand Down
4 changes: 2 additions & 2 deletions social_core/backends/azuread.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def access_token_url(self):
return self.ACCESS_TOKEN_URL.format(base_url=self.base_url)

def get_user_id(self, details, response):
"""Use upn as unique id"""
return response.get("upn")
"""Use subject (sub) claim as unique id."""
return response.get("sub")
Copy link
Member

@nijel nijel Apr 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes uid for existing installations what would be a breaking change. Why is ⁣upn not present in your claim?


def get_user_details(self, response):
"""Return user details from Azure AD account"""
Expand Down