diff --git a/CHANGELOG.md b/CHANGELOG.md index c42037cf4..fe9125bac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to - ✨(backend) support creating subdoc from file #1987 - ✨(buildpack) add PaaS deployment support, tested with Scalingo #2293 +- 🔧(backend) allow configuring settings OIDC_OP_USER_ENDPOINT_FORMAT ### Fixed diff --git a/docs/env.md b/docs/env.md index 8eb347b86..7577e4ffe 100644 --- a/docs/env.md +++ b/docs/env.md @@ -105,6 +105,7 @@ These are the environment variables you can set for the `impress-backend` contai | OIDC_OP_LOGOUT_ENDPOINT | Logout endpoint for OIDC | | | OIDC_OP_TOKEN_ENDPOINT | Token endpoint for OIDC | | | OIDC_OP_USER_ENDPOINT | User endpoint for OIDC | | +| OIDC_OP_USER_ENDPOINT_FORMAT | user endpoint format. Values can be `AUTO`, `JSON` or `JWT`| `AUTO` | | | OIDC_REDIRECT_ALLOWED_HOSTS | Allowed hosts for OIDC redirect url | [] | | OIDC_REDIRECT_REQUIRE_HTTPS | Require https for OIDC redirect url | false | | OIDC_RP_CLIENT_ID | Client id used for OIDC | impress | diff --git a/src/backend/impress/settings.py b/src/backend/impress/settings.py index a2f4554a3..9b07e0740 100755 --- a/src/backend/impress/settings.py +++ b/src/backend/impress/settings.py @@ -22,6 +22,7 @@ from configurations import Configuration, values from corsheaders.defaults import default_headers from csp.constants import NONE from lasuite.configuration.values import SecretFileValue +from lasuite.oidc_login.enums import OIDCUserEndpointFormat from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.logging import ignore_logger @@ -614,6 +615,12 @@ class Base(Configuration): OIDC_OP_USER_ENDPOINT = values.Value( None, environ_name="OIDC_OP_USER_ENDPOINT", environ_prefix=None ) + OIDC_OP_USER_ENDPOINT_FORMAT = values.Value( + OIDCUserEndpointFormat.AUTO.name, + environ_name="OIDC_OP_USER_ENDPOINT_FORMAT", + eviron_prefix=None, + choices=[e.name for e in OIDCUserEndpointFormat], + ) OIDC_OP_LOGOUT_ENDPOINT = values.Value( None, environ_name="OIDC_OP_LOGOUT_ENDPOINT", environ_prefix=None )