From 0356374870a004a7728980c8ededdc11427c83de Mon Sep 17 00:00:00 2001 From: Artur Borecki Date: Thu, 19 Mar 2026 15:26:42 +0100 Subject: [PATCH] feat(settings/base.py): add OAUTH2_PROVIDER config --- kursy/settings/base.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kursy/settings/base.py b/kursy/settings/base.py index bb5d1aa..d2b95d9 100644 --- a/kursy/settings/base.py +++ b/kursy/settings/base.py @@ -133,6 +133,26 @@ SOCIALACCOUNT_PROVIDERS = { WSGI_APPLICATION = "kursy.wsgi.application" +OAUTH2_PROVIDER = { + "OIDC_ENABLED": True, + "OIDC_RPID_ENDPOINT": "http://127.0.0.1:8000/oauth2", + "OIDC_ISS_ENDPOINT": "http://127.0.0.1:8000", + "PKCE_REQUIRED": False, + "OAUTH2_VALIDATOR_CLASS": "kursy.oauth_validators.CustomOAuth2Validator", + "SCOPES": { + "openid": "OpenID Connect scope", + "profile": "User profile scope", + "email": "User email scope", + "read": "Read scope", + "write": "Write scope", + }, + "OIDC_CLAIM_MAPS": { + "nickname": "preferred_username", + "email": "email", + }, + "DEFAULT_SCOPES": ["openid", "profile", "email"], +} + # Database # https://docs.djangoproject.com/en/6.0/ref/settings/#databases