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

Add AzureADOauth2 backend using the v2.0 API. #931

Merged
merged 1 commit into from
Sep 2, 2024
Merged
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
11 changes: 11 additions & 0 deletions social_core/backends/azuread.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,14 @@ def get_auth_token(self, user_id):
new_token_response = self.refresh_token(token=access_token)
access_token = new_token_response["access_token"]
return access_token


class AzureADOAuth2V2(AzureADOAuth2):
"""Version of the AzureADOAuth2 backend that uses the v2.0 API endpoints,
supporting users with personal Microsoft accounts, if the app settings
allow them."""

name = "azuread-oauth2-v2"
AUTHORIZATION_URL = "{base_url}/oauth2/v2.0/authorize"
ACCESS_TOKEN_URL = "{base_url}/oauth2/v2.0/token"
DEFAULT_SCOPE = ["User.Read profile openid email"]
Loading