This commit is contained in:
Víðir Valberg Guðmundsson 2024-03-03 11:04:41 +01:00
parent 535543f82f
commit 9a884c782c
2 changed files with 17 additions and 0 deletions

View File

@ -42,6 +42,7 @@ THIRD_PARTY_APPS = [
"allauth.account",
"django_view_decorator",
"django_registries",
"oauth2_provider",
]
LOCAL_APPS = [
@ -156,6 +157,21 @@ ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False
ACCOUNT_USERNAME_REQUIRED = False
# OAuth2 configuration
OAUTH2_PROVIDER = {
"OIDC_ENABLED": True,
"OIDC_RSA_PRIVATE_KEY": env.str("OIDC_RSA_PRIVATE_KEY"),
# "OIDC_RSA_PRIVATE_KEYS_INACTIVE": [
# env.str("OIDC_RSA_PRIVATE_KEY_2"),
# env.str("OIDC_RSA_PRIVATE_KEY_3"),
# ],
"SCOPES": {
"openid": "OpenID Connect scope",
"profile": "Profile Information",
},
"PKCE_REQUIRED": False, # this can be a callable - https://github.com/jazzband/django-oauth-toolkit/issues/711#issuecomment-497073038
}
# Logging
# We want to log everything to stdout in docker
LOGGING = {

View File

@ -7,6 +7,7 @@ from django_view_decorator import include_view_urls
urlpatterns = [
path("", include_view_urls(extra_modules=["project.views"])),
path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
path("accounts/", include("allauth.urls")),
path("_admin/", admin.site.urls),
]