From 24d58a1aa5e88402c14220e1f98a21bc96fd1986 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Thu, 21 May 2026 16:24:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(backend)=20allow=20configuring=20s?= =?UTF-8?q?ettings=20OIDC=5FOP=5FUSER=5FENDPOINT=5FFORMAT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The djang-lasuite package manages the settings OIDC_OP_USER_ENDPOINT_FORMAT allowing to enforce the format use by the user endpoint. By default it is set to `AUTO`. --- CHANGELOG.md | 1 + docs/env.md | 1 + src/backend/impress/settings.py | 7 +++++++ 3 files changed, 9 insertions(+) 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 )