Browse Source

Skip OAuth2 for OIDC backend

pull/675/head
Setu Shah 4 years ago
parent
commit
6bfd188503
1 changed files with 5 additions and 0 deletions
  1. 5
      app/server/social_auth.py

5
app/server/social_auth.py

@ -79,6 +79,11 @@ def fetch_okta_oauth2_permissions(strategy, details, user=None, is_new=False, *a
if not user or not isinstance(kwargs['backend'], OktaOAuth2): if not user or not isinstance(kwargs['backend'], OktaOAuth2):
return return
# OktaOpenIdConnect inherits `OktaOAuth2`, so we have to explicitly skip OAuth2 trying
# to fetch permissions when using OIDC backend.
if isinstance(kwargs['backend'], OktaOpenIdConnect):
return
response = requests.post( response = requests.post(
url=f"{org_url}/v1/userinfo", url=f"{org_url}/v1/userinfo",
headers={ headers={

Loading…
Cancel
Save