Repository navigation
Fixes #5183: configurable trusted redirect URIs for browser-extension login - #30287
Conversation
…ension login PR #26314 added an exact-match redirect-URI allowlist to /api/v1/auth/login built only from callbackUrl and the server's /auth/callback and /mcp/callback. Browser-extension logins redirect to https://<extension-id>.chromiumapp.org/<path>, which cannot be registered anywhere, so login returned 400 "Redirect URI must exactly match a trusted redirect URI". Add an optional authenticationConfiguration.additionalTrustedRedirectUris list and merge it into the allowlist in both the OIDC (requireRedirectUri) and SAML (trustedSamlRedirects) handlers. Exact-match semantics are preserved, so this does not reopen the open-redirect hole; wildcard host matching was intentionally avoided as it would let any extension receive a token. Defaults to empty, so existing deployments are unchanged and must opt in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ 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 |
🟡 Playwright Results — all passed (21 flaky)✅ 4542 passed · ❌ 0 failed · 🟡 21 flaky · ⏭️ 95 skipped
🟡 21 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
✅ TypeScript Types Auto-UpdatedThe generated TypeScript types have been automatically updated based on JSON schema changes in this PR. |
| Set<String> trusted = | ||
| org.openmetadata.service.security.SecurityUtil.trustedRedirects( | ||
| authConfig.getCallbackUrl(), samlSpCallback(), samlAuthCallback()); | ||
| trusted.addAll(listOrEmpty(authConfig.getAdditionalTrustedRedirectUris())); | ||
| return trusted; |
| "additionalTrustedRedirectUris": { | ||
| "title": "Additional Trusted Redirect URIs", | ||
| "description": "Additional redirect URIs allowed for the login flow, beyond the callback URL and the server's own callbacks. Each entry must exactly match the requested redirect URI (scheme, host, port, path, query). Use this to allow browser-extension login redirects such as 'https://<extension-id>.chromiumapp.org/<path>'.", |
| # Additional redirect URIs allowed for the login flow (beyond callbackUrl and the server callbacks). | ||
| # Each entry must exactly match the requested redirect URI. Use for browser-extension logins, | ||
| # e.g. ["https://<extension-id>.chromiumapp.org/auth0"]. |
|
|
Code Review ✅ ApprovedAdds optional additionalTrustedRedirectUris to the authentication configuration schema, enabling browser-extension OIDC and SAML login flows. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
… login (#30287) * Fixes #5183: allow configurable trusted redirect URIs for browser-extension login PR #26314 added an exact-match redirect-URI allowlist to /api/v1/auth/login built only from callbackUrl and the server's /auth/callback and /mcp/callback. Browser-extension logins redirect to https://<extension-id>.chromiumapp.org/<path>, which cannot be registered anywhere, so login returned 400 "Redirect URI must exactly match a trusted redirect URI". Add an optional authenticationConfiguration.additionalTrustedRedirectUris list and merge it into the allowlist in both the OIDC (requireRedirectUri) and SAML (trustedSamlRedirects) handlers. Exact-match semantics are preserved, so this does not reopen the open-redirect hole; wildcard host matching was intentionally avoided as it would let any extension receive a token. Defaults to empty, so existing deployments are unchanged and must opt in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Update generated TypeScript types --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 2e4af5d)



Describe your changes:
Fixes
open-metadata/openmetadata-collate#5183.GET /api/v1/auth/login?redirectUri=<uri>returns 400 Bad Request for browser-extension redirect URIs (e.g. Chrome extensionhttps://<extension-id>.chromiumapp.org/...), blocking extension-based OIDC/SAML login.Root cause: #26314 added an exact-match redirect-URI allowlist. The allowlist was built only from
authenticationConfiguration.callbackUrl,serverUrl + /auth/callback, andserverUrl + /mcp/callback, with no way to register any other destination — so browser-extension redirects can never match and are rejected.Fix: add an optional
authenticationConfiguration.additionalTrustedRedirectUris(list of strings) and merge it into the allowlist in both the OIDC (AuthenticationCodeFlowHandler.requireRedirectUri) and SAML (SamlAuthServletHandler.trustedSamlRedirects) handlers — the two shared points every login-flow caller routes through.*.chromiumapp.org) was intentionally not used: it would let any browser extension receive an OM token.[]) — existing deployments are unchanged and must explicitly opt in.Configure via env var:
No DB migration required — this is a configuration schema, not a stored-entity schema.
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>AuthenticationCodeFlowHandlerTest: configured extension redirect is allowed, unconfigured one is still rejected).🤖 Generated with Claude Code
Greptile Summary
This PR adds configurable redirect destinations for browser-extension login flows. The main changes are:
additionalTrustedRedirectUristo the authentication schema and default YAML configuration.Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into guangzhou" | Re-trigger Greptile
Context used (3)