Cherry pic/1.13 sso fix - #31573
Conversation
…ionAlgorithm from /config/auth (#29597) (#31516) ConfigResource.getAuthConfig() builds a fresh AuthenticationConfiguration and hand-copies only a subset of fields from the persisted config. It never copied responseType, publicKeyUrls, or tokenValidationAlgorithm, so those fell back to their JSON-schema POJO defaults (responseType="id_token", publicKeyUrls=[]) regardless of what was configured. For AWS Cognito (and any provider) configured with responseType="code", the public /api/v1/system/config/auth endpoint therefore served "id_token", pushing the browser onto the implicit flow — no server-side session, the user bounces back to /signin, and login never completes. Copy the three login-relevant public fields from the persisted config. Tests: - ConfigResourceTest (unit): mocks the config singleton and proves getAuthConfig reflects persisted responseType/publicKeyUrls/tokenValidationAlgorithm; fails before the fix (code->id_token, [url]->[]). - ConfigResourceIT: adds a real-server invariant cross-checking /config/auth against the admin /security/config; drops the stale assertion that required publicKeyUrls to be empty. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit d0aeedd)
…ders (#29597) (#31517) * fix(ui): respect server-configured OIDC responseType across all providers (#29597) getUserManagerConfig — the config handed to the oidc-client UserManager — never forwarded responseType, so oidc-client fell back to its built-in 'id_token' default. Every front-channel OIDC login (AWS Cognito, Google, Custom OIDC public clients) therefore sent response_type=id_token regardless of the server config, forcing the implicit flow: no server session, bounce back to /signin, login never completes. Changes: - getUserManagerConfig: forward response_type from the resolved config (defaulting to the authorization-code flow, not id_token). - getAuthConfig: every provider now honors the server-provided responseType instead of a hardcoded value; AWS Cognito no longer hardcodes 'code' and falls back to 'code' only when the server omits it (Google/Custom OIDC keep their historical 'id_token' fallback). Combined with the backend fix, the persisted responseType flows through end-to-end. - getCandidateUserManagerConfig (SSO test-login popup): respect responseType instead of hardcoding 'id_token'. Tests: - AuthProvider.util.test.ts (Jest): 9 cases proving getUserManagerConfig, getAuthConfig (Cognito/Google/Custom OIDC), and getCandidateUserManagerConfig respect the server responseType. Verified RED before the fix (response_type undefined; Cognito 'id_token'->'code' hardcode), GREEN after. - Playwright SSO harness: new public-client provider 'keycloak-oidc-public' (the only path that traverses getUserManagerConfig) plus a keycloak realm public client with implicit flow disabled, and a response_type assertion on the IdP authorize redirect in SSOLogin.spec.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * refactor(ui): keep id_token as the responseType default (review) Address review: don't change any default from id_token to code. Restore the blanket `responseType = 'id_token'` destructure default in getAuthConfig (matches the authenticationConfiguration schema default) and drop the per-provider `?? 'code'`/`?? 'id_token'` overrides. AWS Cognito now simply passes `responseType` through (respecting the server value) instead of hardcoding 'code' — the hardcoded value never reached the browser anyway, since getUserManagerConfig dropped the field. The two UserManager builders keep 'id_token' as the fallback. Net change is now just: forward responseType in getUserManagerConfig / getCandidateUserManagerConfig, and stop Cognito hardcoding 'code'. Tests updated: absent-responseType cases now assert the id_token schema default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit e4abbec)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| import { | ||
| getAuthConfig, | ||
| getCandidateUserManagerConfig, | ||
| getUserManagerConfig, |
There was a problem hiding this comment.
🚨 Bug: Test imports non-existent getCandidateUserManagerConfig
AuthProvider.util.test.ts imports getCandidateUserManagerConfig from ./AuthProvider.util, but that function is not defined or exported anywhere in the codebase (only referenced in the test). The import resolves to undefined, so the getCandidateUserManagerConfig(...) call in the 'SSO test-login popup respects responseType' test throws TypeError: getCandidateUserManagerConfig is not a function, failing the suite. Either add and export getCandidateUserManagerConfig in AuthProvider.util.ts or remove that describe block and import.
Was this helpful? React with 👍 / 👎
Code Review 🚫 Blocked 0 resolved / 1 findingsUpdates OIDC authentication configuration and UI providers to respect server-configured response types, but the new tests fail due to importing a non-existent getCandidateUserManagerConfig from AuthProvider. 🚨 Bug: Test imports non-existent getCandidateUserManagerConfig📄 openmetadata-ui/src/main/resources/ui/src/utils/AuthProvider.util.test.ts:23 📄 openmetadata-ui/src/main/resources/ui/src/utils/AuthProvider.util.test.ts:131-138 AuthProvider.util.test.ts imports 🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ UI Checkstyle Failed❌ ESLint + Prettier + Organise Imports (src)One or more source files have linting or formatting issues. ❌ Core Components - I18n SyncCore-components ❌ Tailwind AuditHardcoded Tailwind values found. Use a design-system utility (run ❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
Describe your changes:
Fixes #
I worked on ... because ...
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Summary by Gitar
responseType,publicKeyUrls, andtokenValidationAlgorithmfrom/config/auth(Bug:/api/v1/system/config/authserves a frozen/stale authentication config that does not update regardless of env vars, database state, or provider changes — breaks SSO login end-to-end #29597)AuthProvider.util.ts(Bug:/api/v1/system/config/authserves a frozen/stale authentication config that does not update regardless of env vars, database state, or provider changes — breaks SSO login end-to-end #29597)ConfigResourceandAuthProviderutilitiesThis will update automatically on new commits.