diff --git a/app/auth/views/oidc.py b/app/auth/views/oidc.py index bbda54358..f5f1f98d9 100644 --- a/app/auth/views/oidc.py +++ b/app/auth/views/oidc.py @@ -36,7 +36,7 @@ def oidc_login(): auth_url = requests.get(config.OIDC_WELL_KNOWN_URL).json()["authorization_endpoint"] oidc = OAuth2Session( - config.OIDC_CLIENT_ID, scope=[OIDC_SCOPES], redirect_uri=redirect_uri + config.OIDC_CLIENT_ID, scope=OIDC_SCOPES, redirect_uri=redirect_uri ) authorization_url, state = oidc.authorization_url(auth_url) @@ -66,7 +66,7 @@ def oidc_callback(): oidc = OAuth2Session( config.OIDC_CLIENT_ID, state=session[SESSION_STATE_KEY], - scope=[OIDC_SCOPES], + scope=OIDC_SCOPES, redirect_uri=redirect_uri, ) oidc.fetch_token( diff --git a/app/config.py b/app/config.py index e0e395766..a413e5a16 100644 --- a/app/config.py +++ b/app/config.py @@ -314,7 +314,7 @@ def facebook_enabled(): OIDC_WELL_KNOWN_URL = os.environ.get("OIDC_WELL_KNOWN_URL") OIDC_CLIENT_ID = os.environ.get("OIDC_CLIENT_ID") OIDC_CLIENT_SECRET = os.environ.get("OIDC_CLIENT_SECRET") -OIDC_SCOPES = os.environ.get("OIDC_SCOPES") +OIDC_SCOPES = os.environ.get("OIDC_SCOPES", "openid email profile").split() OIDC_NAME_FIELD = os.environ.get("OIDC_NAME_FIELD", "name") PROTON_CLIENT_ID = os.environ.get("PROTON_CLIENT_ID")