OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Bug: `/api/v1/system/config/auth` serves a frozen/stale authentication config that does not update regardless of env vars, database state, or provider changes — breaks SSO login end-to-end

Open Pikachu051 opened this issue 5 months ago • 2 comments

Affected module

Authentication / Security

Describe the bug

Affected module

Backend — authentication configuration bootstrap / settings cache (org.openmetadata.service.resources.settings.SettingsCache, SystemResource or equivalent serving /api/v1/system/config/auth).

OpenMetadata version

  • First observed: 1.10.1
  • Still present after upgrading to: 1.12.12 (latest 1.12.x patch as of June 2026)
  • Deployment: ECS (EC2 launch type, networkMode: host), single task, 5 containers (postgresql, elasticsearch, server, ingestion, migrate), PostgreSQL backing store, env vars supplied via ECS S3 environmentFiles

Summary

The unauthenticated, public endpoint GET /api/v1/system/config/auth — which the React frontend reads on page load to determine the SSO/login button and OAuth flow to initiate — returns a response that does not reflect the actual configured/persisted authentication settings. This was first observed in 1.10.1 (where it coincided with a HV000116 Hibernate validation crash on every boot) and persists identically in 1.12.12, even though the original validation crash is gone.

Critically, in 1.12.12 we confirmed the served config is completely frozen — it does not update even when:

  • The underlying authenticationConfiguration row in Postgres is corrected directly
  • The container's actual environment variables are corrected and verified clean
  • AUTHENTICATION_PROVIDER is changed from aws-cognito to basic and the task is fully redeployed (new ECS task, fresh container) In the basic auth test specifically: the live /signin page continued to render only the "Sign in with AWS Cognito" button — i.e. the frontend still believed provider: aws-cognito was active, despite the container's actual env var being AUTHENTICATION_PROVIDER=basic and a brand new task having been launched. This suggests the served config is not derived from current env vars, current DB state, or a fresh JVM boot at all, but some other source that's effectively pinned to whatever the very first install's configuration was.

Real-world impact

This is not just a diagnostic/introspection bug — it actively breaks SSO login:

  1. Because the live config falsely reports responseType: id_token (when the actual configured/stored value is code), the frontend initiates an implicit grant flow against the IdP instead of authorization code flow.
  2. The IdP (AWS Cognito, with both Authorization Code and Implicit grant enabled on the app client) honors the implicit request and redirects back with id_token=... directly in the callback URL query string.
  3. Because the frontend's session-bootstrap logic expects the code-exchange flow, no server-side session is established. The subsequent GET /api/v1/users/loggedInUser call fails with 401 {"code":401,"message":"Token not present"}.
  4. The user is bounced back to /signin. The broken config is served again. The app falls into a loop calling GET /api/v1/auth/refresh, which returns 200 with valid, fresh JWTs each time (apparently from a silent-renew flow against the IdP) — but the user is never actually transitioned to a logged-in state. Effectively: working tokens are minted continuously, but the application never authenticates the session.

Possibly related

  • #26384 — AUTHENTICATION_TOKEN_VALIDATION_ALGORITHM env var not applied to the persisted authenticationConfiguration, reproduced on 1.11.13 and 1.12.1. Different specific field, but the same general bug class: env-var-to-persisted-config sync for authenticationConfiguration appears unreliable across the 1.11.x–1.12.x line. Our case differs in that the Postgres row itself is correct, but the served value still doesn't match — suggesting there may be two separate but related bugs: one in how env vars sync into the DB-backed settings record (per #26384), and a second one in how /api/v1/system/config/auth serves its response (per this report), since fixing the DB row directly didn't fix what's served.

To Reproduce

  1. Configure OpenMetadata with AUTHENTICATION_PROVIDER=aws-cognito (or any OIDC-based provider), AUTHENTICATION_RESPONSE_TYPE=code, AUTHENTICATION_PUBLIC_KEYS=[<jwks-url-1>,<jwks-url-2>], all via the standard openmetadata.yaml env var substitutions.
  2. Boot the server. Confirm via direct Postgres query that the persisted row is correct:
   SELECT json FROM openmetadata_settings WHERE configtype = 'authenticationConfiguration';

→ Row correctly shows "responseType": "code" and a populated publicKeyUrls array. 3. Confirm via docker exec <container> env | grep AUTHENTICATION that the container's actual environment variables are correct and unmangled (no encoding/line-ending issues — verified clean in our case). 4. Confirm via docker exec <container> cat /opt/openmetadata/conf/openmetadata.yaml that the shipped YAML's variable substitution syntax (responseType: ${AUTHENTICATION_RESPONSE_TYPE:-id_token}, publicKeyUrls: ${AUTHENTICATION_PUBLIC_KEYS:-[...]}) is unchanged from the documented/main branch template. 5. Hit GET /api/v1/system/config/auth (no auth required). 6. Expected: responseType: "code", publicKeyUrls: [<your configured URLs>]. 7. Actual: responseType: "id_token", publicKeyUrls: [] — i.e. the schema defaults, not the configured values. 8. As a further test: change AUTHENTICATION_PROVIDER to basic, fully redeploy with a brand-new container/task (not a restart of the same container), and reload /signin. 9. Expected: Login page shows username/password fields (basic auth). 10. Actual: Login page still shows only "Sign in with AWS Cognito" — i.e. even the provider field is being served from a source that doesn't reflect the current configuration or a fresh boot.

Expected behavior

GET /api/v1/system/config/auth should always reflect the currently configured/persisted authenticationConfiguration, recomputed fresh on every server boot at minimum, and should respond to provider/responseType/publicKeyUrls changes after a full redeploy.

OS

Amazon Linux 2 (ECS-optimized AMI) host, OpenMetadata running in Docker via ECS (EC2 launch type)

Python version

N/A — using Docker

OpenMetadata version

1.10.1 and 1.12.12

OpenMetadata Ingestion package version

docker.getcollate.io/openmetadata/ingestion:1.10.1 and docker.getcollate.io/openmetadata/ingestion:1.12.12

Additional context

openmetadata_ingestion (Redacted).env.txt openmetadata_elasticsearch (Redacted).env.txt execute-migrate-all (Redacted).env.txt openmetadata-server (Redacted).env.txt openmetadata_postgresql (Redacted).env.txt open-metadata-revision14 (Redacted).json

Deployment topology: Single-instance ECS deployment (EC2 launch type, networkMode: host), 5 containers per task (postgresql, elasticsearch, server, ingestion, a non-essential migrate container that runs openmetadata-ops.sh migrate on every task launch). Each container pulls its environment variables from a separate S3-hosted .env file via ECS environmentFiles. PostgreSQL and Elasticsearch use host-bind-mounted volumes for persistence.

History: This was first observed on OpenMetadata 1.10.1, where it coincided with a recurring Hibernate validation crash on every server boot (IllegalArgumentException: HV000116: The object to be validated must not be null, thrown from SettingsCache.createDefaultConfiguration() → SystemRepository.updateSetting/createNewSetting). We upgraded to 1.12.12 partly hoping this would resolve the issue. The validation crash is indeed gone in 1.12.12 — confirmed via log search, no occurrences post-upgrade. However, the config-serving behavior at /api/v1/system/config/auth is identical to before: wrong responseType, empty publicKeyUrls, regardless of what's actually configured.

What we tried that did not resolve it:

  • Directly correcting the authenticationConfiguration row in Postgres via psql (confirmed correct afterward via direct query, but the served endpoint remained wrong)
  • Restarting the server container alone
  • A full ECS task stop/relaunch (brand-new container, fresh JVM boot) — including once specifically to test a provider change (aws-cognito → basic), which also had no effect on what was served or rendered in the login UI
  • Verifying environment variables inside the running container directly (docker exec <id> env) — confirmed clean and correct
  • Verifying the shipped openmetadata.yaml template inside the container uses standard, correct ${ENV_VAR:-default} substitution syntax matching the public repo

We're happy to provide the full ECS task definition (account/region redacted), complete env files (secrets redacted), and additional log excerpts on request. This is a production-blocking issue for us specifically because it forces an implicit OAuth grant flow that our identity provider honors but our deployment's login flow doesn't complete, making SSO login completely non-functional.

Pre-submission checklist

  • [x] I searched for duplicate issues.
  • [x] I removed credentials, hostnames, emails, and other sensitive data from logs and config.

Pikachu051 avatar Jun 30 '26 04:06 Pikachu051

Hello @Pikachu051 Can I takeover this issue?, I genuinely want to fix this bug!

Sumedh-6504 avatar Jul 15 '26 05:07 Sumedh-6504

I'm having the same problem. My Helm chart values ​​were initially configured with incorrect SSO parameters. I tried to fix them, but the configuration won't update at all—it keeps to the old settings.

andreyolv avatar Aug 07 '26 14:08 andreyolv