Skip to content

Repair a SAML browser callback saved as the ACS URL - #38488

Merged
manerow merged 6 commits into
mainfrom
fix/saml-callback-acs-repair
Nov 23, 2026
Merged

manerow merged 6 commits into
mainfrom
fix/saml-callback-acs-repair

Conversation

@manerow

@manerow manerow commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Follow-up to PR #38219. The 2.0 and 2.1 copies get the same change in PR #38441 and PR #38302.

1. Repair a SAML browser callback that points at the ACS URL.
The identity provider POSTs to the ACS URL (/api/v1/saml/acs); the user then lands on the browser callback (/callback). An intermediate version of cleanupSamlSp, shipped only in unreleased code, saved the ACS URL into both callbackUrl and sp.callback. PR #38219 stopped new saves from doing that but kept existing wrong values, so a login started without a redirect parameter (GET /api/v1/saml/login) ends on the POST-only ACS servlet with a 405.

resolveSamlBrowserCallback now skips a saved callback that equals the ACS URL or ends with /api/v1/saml/acs, keeps the first usable one of callbackUrl and sp.callback, and otherwise derives /callback next to the ACS, keeping any base path (https://host/om/api/v1/saml/acs gives https://host/om/callback). cleanupProviderSpecificFields now works on a deep copy and the form keeps its own copy of the saved configuration: before, the cleanup also rewrote the saved snapshot, so the repair never reached the PATCH. The next save repairs the stored value.

2. Update the idpX509Certificate description.
It still said expired keys are dropped when settings are built. Since ADR:2026-11-20-saml-runtime-trust-preserves-configured-signing-keys, every configured certificate is trusted at runtime, expired ones included, so a retired key must be removed by hand; saving still needs one currently valid certificate. The schema and its generated copies are updated together, as PR #38219 did.

No issue exists for this follow-up, so Validate PR Metadata will fail.

Type of change:

  • Bug fix

High-level design:

N/A, small change.

Tests:

Use cases covered

  • A configuration whose callbackUrl, sp.callback and sp.acs all point at /api/v1/saml/acs is saved through the SSO form with a PATCH that sets both callbacks to /callback; the ACS URL is kept.
  • Under a base path, with or without trailing slashes, the derived callback keeps the base path.
  • A working sp.callback is kept when only callbackUrl is the ACS URL.
  • A correct callback is kept; an empty one gets the derived callback.
  • A custom authorizer class and request filter are kept.

Unit tests

  • SSOUtils.test.ts and useSsoConfiguration.test.ts: the new cases fail without their fix (the hook test sees no PATCH at all) and pass with it.
  • yarn test src/components/SettingsSso src/utils/SSOUtils: 13 suites, 467 tests passed. ESLint and Prettier clean.
  • mvn -pl openmetadata-spec package passes.

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • Not applicable (covered by unit tests).

Manual testing performed

None.

UI screen recording:

Not applicable: no visible UI change.

Checklist:

  • I have read the CONTRIBUTING document.
  • For JSON Schema changes: only a description changed, so no migration is needed.
  • I have added a test that covers the exact scenario we are fixing.

Summary by Gitar

  • Authorizer settings:
    • Kept a configured className and containerRequestFilter when saving SSO settings; defaults fill only missing values

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; both previous issues are addressed.

Summary

Repairs saved SAML browser callbacks without changing the ACS URL.

  • SAML settings saves repair browser callbacks that point to the ACS.
  • SSO saves keep configured custom authorizer names.
  • SAML certificate guidance matches the configured runtime trust rules.

Both previous, unnumbered review threads are fully addressed. No new actionable issues were found.

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

@manerow
manerow requested a review from a team as a code owner November 23, 2026 12:16
@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

Preserving custom authorizer and request-filter classes during SSO saves changes authorization behavior; retained custom rules could grant or deny access unexpectedly.

Repairs the SAML browser callback that was saved as the ACS URL, so logins without a redirect parameter no longer end on the POST-only ACS endpoint with a 405, and keeps a configured authorizer class and request filter when saving SSO settings. Resolved the finding where the ACS-callback repair dropped the base path from the replacement URL. No open issues found.

✅ 1 closed
✅ Edge Case: ACS-callback repair drops the base path from the replacement URL

📄 openmetadata-ui/src/main/resources/ui/src/utils/SSOUtils.ts:590-591 📄 openmetadata-ui/src/main/resources/ui/src/utils/SSOUtils.ts:597-609
The repair throws away a saved callback whose path ends with /api/v1/saml/acs and falls back to ${url.origin}/callback. That fallback keeps only the origin. On a deployment under a base path (BASE_PATH=/openmetadata, see ADR:2026-11-17-base-path-has-one-trailing-slash-in-html-and-none-at-runtime), the ACS is https://host/openmetadata/api/v1/saml/acs, so the 'repaired' callback is https://host/callback. That URL is outside the UI's router basename. Those installs go from a 405 on the ACS to a broken landing page after login. The PR describes the result as a repair, but it doesn't fix their callback.

Fix: when the ACS path ends with SAML_ACS_PATH, build the callback from the prefix in front of that suffix, so the base path survives. Add a test case that uses a prefixed 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

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

UI browser tests

Ran: all test files (no impact map from main yet)

Result: ❌ 2 failed · 1068 passed · 154 skipped

Changed code executed by these browser tests: 3 / 14 lines (21%)

File Changed lines Executed %
src/utils/SSOUtils.ts 14 3 21%
Changed files no browser test loads
  • src/components/SettingsSso/useSsoConfiguration.ts

@manerow
manerow merged commit 585b20c into main Nov 23, 2026
78 of 86 checks passed
@manerow
manerow deleted the fix/saml-callback-acs-repair branch November 23, 2026 13:59
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.

3 participants