Skip to content

[2.0] Fixes #37056: keep expired IdP certificates at startup and the SAML browser callback (backport #38219) - #38441

Merged
manerow merged 10 commits into
2.0from
backport/2.0/saml-startup-callback-fixes
Nov 23, 2026
Merged

manerow merged 10 commits into
2.0from
backport/2.0/saml-startup-callback-fixes

Conversation

@manerow

@manerow manerow commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37056

This brings the last SAML fixes from #38219 to the 2.0 branch. #38197 already backported an earlier version of #38219, so 2.0 still has two problems that main and 2.1 (#38302) no longer have:

  1. The server does not start when every saved IdP certificate has expired. Building the SAML settings dropped expired certificates and threw when none were left. That runs during startup, so the whole server failed to start, not only SAML sign-in. java-saml never checked certificate dates.
  2. Saving the SAML form could turn the post-login redirect into the ACS URL. For a configuration whose ACS is /api/v1/saml/acs (the yaml default), a login started without a redirect parameter ended on that servlet, which only accepts POST.

Changes, cherry-picked from #38219:

  • Runtime SAML settings keep every configured IdP certificate, including expired ones. Saving a configuration still requires at least one currently valid certificate.
  • The browser callback is kept separate from the ACS URL when the form is saved.
  • The "Require Encrypted Assertions" label is translated.
  • The decision records from Fixes #37056: SAML trust, Test Login parity and query-cost access checks #38219 (runtime trust keeps configured keys; namespaced principal claims, a pattern 2.0 already has).

Adapted for 2.0:

  • The EmailFirstUserProvisioner and it-it.json parts were dropped (not on 2.0). TestLoginAccountChecks and TestLoginService keep 2.0's versions (main only added final).
  • The startup test uses mockStatic for SecurityConfigurationManager, since 2.0 has no setCurrentAuthConfig.
  • The UI label test on 2.0 lives in SSO.constant.test.ts, so that is the file updated.
  • Not backported: Fixes #37056: SAML trust, Test Login parity and query-cost access checks #38219's "preserve resolved OIDC flow and subject binding in tests". It builds on the email-first provisioning that 2.0 does not have.

Added after review (main: #38488): a callback saved as the ACS URL is replaced on save (base path kept), and the form no longer changes the saved snapshot, so the repair reaches the PATCH, and a custom authorizer is no longer reset. The idpX509Certificate description says expired keys stay trusted.

Related: #38317 (2.0.10 migration and IdP certificate check) touches the same files; whichever merges second may need a rebase.

Type of change:

  • Bug fix

High-level design:

Cherry-pick of the final fix commit and the test fix from #38219, with the adaptations above.

Tests:

Unit tests

  • SamlSettingsHolderTest (new initializesLiveSettingsWhenAllSavedIdpCertificatesHaveExpired, preservesExplicitlyConfiguredKeysAtRuntime), SSOUtils.test.ts, SSO.constant.test.ts.
  • Ran locally on this branch: SamlSettingsHolderTest, SamlValidatorTest, SamlResponseValidatorTest, all TestLogin*Test, QueryCostRecordIndexTest, BasicAuthenticatorConfirmationTest: 175 tests, all passing.
  • UI: SettingsSso and SSOUtils Jest, 407 passing; the callback cases fail without the fix.

Integration, ingestion and Playwright tests: not applicable.

UI screen recording / screenshots:

Not applicable: only the label of an existing field is translated.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes #37056 above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

Summary by Gitar

  • Authorizer configuration:
    • Saving keeps a configured className and containerRequestFilter in cleanupAuthorizerConfig
    • Default authorizer values now fill only missing fields, not overwrite them

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new blocking issues were found.

Summary

The PR keeps configured SAML signing certificates available at startup and separates the browser callback from the ACS URL.

  • The server keeps every configured SAML signing certificate at runtime.
  • SSO saves keep browser callbacks separate from service endpoints and stored settings.
  • The encrypted-assertions setting shows text from the selected language.
  • Supporting docs and generated client edits leave sign-in behavior unchanged.

No new actionable issues were found in the changes since the previous review. Keeping expired signing keys is intentional: manerow explains that administrators must remove retired keys explicitly.

Reviews (10) · Last reviewed commit: "Keep a configured authorizer class and r..." · Reviewed by Greptile

@manerow
manerow requested review from a team as code owners November 23, 2026 07:51
@manerow
manerow requested review from karthicksharan and sonika-shah and removed request for a team November 23, 2026 07:51
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk 1 closed / 1 findings

Keeping expired IdP signing certificates trusted at runtime changes the SAML authentication boundary, so retired keys could continue authenticating users.

Keeps expired IdP certificates at server startup and separates the SAML browser callback from the ACS URL on save, with a configured authorizer class and request filter now preserved. Resolved the case where an already-corrupted config kept the ACS URL as the browser callback on re-save. No open issues found.

✅ 1 closed
✅ Bug: Already-corrupted configs keep ACS URL as browser callback on re-save

📄 openmetadata-ui/src/main/resources/ui/src/utils/SSOUtils.ts:580-593 📄 openmetadata-ui/src/main/resources/ui/src/utils/SSOUtils.ts:602-616 📄 openmetadata-ui/src/main/resources/ui/src/utils/SSOUtils.test.ts:726-740
The old cleanupSamlSp wrote the ACS URL into authConfig.callbackUrl, sp.callback and sp.acs, so installations already hit by #37056 have all three set to e.g. /api/v1/saml/acs. On the next save, configuredCallback is authConfig.callbackUrl, which is that same ACS URL. resolveSamlBrowserCallback returns it because the ACS path doesn't end with /callback, so the post-login redirect still points at the POST-only ACS endpoint. Re-saving the form therefore doesn't repair these installations. The new it.each only covers callbacks that are empty or already /callback, so it misses this case. Fix: ignore a configured callback that equals the ACS URL, then fall back to ${origin}/callback, and add a test row where root, SP callback and ACS are all the ACS URL.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit 30e6976 into 2.0 Nov 23, 2026
87 of 95 checks passed
@manerow
manerow deleted the backport/2.0/saml-startup-callback-fixes branch November 23, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants