From 9a08895d5c78533dbcbcdd4ced26eb2e284414e5 Mon Sep 17 00:00:00 2001 From: cln-io <7887972+cln-io@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:24:24 +0200 Subject: [PATCH] new: [OIDC] OIDC_LOGIN_TEXT to customise the login button label Add an optional OIDC_LOGIN_TEXT environment variable that sets the OidcAuth.login_button_text MISP config value, used to customise the label of the OIDC login button shown when OIDC_MIXEDAUTH is enabled. Only applied when set, so behaviour is unchanged by default. Follows the same pattern as the other OIDC_* variables in set_up_oidc(). Requires the companion MISP change that reads OidcAuth.login_button_text in app/View/Users/login.ctp (defaults to "Login with OIDC"). --- core/files/configure_misp.sh | 18 +++++++++++++++++- docker-compose.yml | 1 + template.env | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/core/files/configure_misp.sh b/core/files/configure_misp.sh index 3bfea55..2fcee2a 100755 --- a/core/files/configure_misp.sh +++ b/core/files/configure_misp.sh @@ -120,6 +120,21 @@ set_up_oidc() { }" > /dev/null fi + # Set a custom label for the OIDC login button (shown when OIDC_MIXEDAUTH is enabled). + # Enforced on every start: when unset, clear any previous value so MISP falls back to + # its default ("Login with OIDC") instead of keeping a stale label. + if [[ -n "${OIDC_LOGIN_TEXT}" ]]; then + # JSON-encode the value so labels containing quotes/backslashes don't break the payload + OIDC_LOGIN_TEXT_JSON=$(printf '%s' "${OIDC_LOGIN_TEXT}" | jq -Rs .) + else + OIDC_LOGIN_TEXT_JSON='""' + fi + sudo -u www-data php /var/www/MISP/tests/modify_config.php modify "{ + \"OidcAuth\": { + \"login_button_text\": ${OIDC_LOGIN_TEXT_JSON} + } + }" > /dev/null + # Set the custom logout URL for OIDC if it is defined if [[ -n "${OIDC_LOGOUT_URL}" ]]; then if [[ "${OIDC_LOGOUT_URL}" == *"?"* ]]; then @@ -148,7 +163,8 @@ set_up_oidc() { \"code_challenge_method\": \"\", \"roles_property\": \"\", \"role_mapper\": \"\", - \"default_org\": \"\" + \"default_org\": \"\", + \"login_button_text\": \"\" } }" > /dev/null diff --git a/docker-compose.yml b/docker-compose.yml index 9bf7e52..641d2f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -179,6 +179,7 @@ services: - "OIDC_ROLES_MAPPING=${OIDC_ROLES_MAPPING}" - "OIDC_DEFAULT_ORG=${OIDC_DEFAULT_ORG}" - "OIDC_MIXEDAUTH=${OIDC_MIXEDAUTH}" + - "OIDC_LOGIN_TEXT=${OIDC_LOGIN_TEXT}" - "OIDC_AUTH_METHOD=${OIDC_AUTH_METHOD}" - "OIDC_REDIRECT_URI=${OIDC_REDIRECT_URI}" - "OIDC_SCOPES=${OIDC_SCOPES}" diff --git a/template.env b/template.env index cc3cd84..7afe18b 100644 --- a/template.env +++ b/template.env @@ -192,6 +192,7 @@ SYNCSERVERS_1_PULL_RULES= # OIDC_ROLES_MAPPING="{\"admin\": 1}" # OIDC_DEFAULT_ORG= # OIDC_MIXEDAUTH=true +# OIDC_LOGIN_TEXT="Login with OIDC" # OIDC_AUTH_METHOD="client_secret_post" # OIDC_REDIRECT_URI= # OIDC_SCOPES="[\"profile\", \"email\"]"