Skip to content

Fixes #39253: Accept SAML strict-mode sign-ins behind a TLS-terminating proxy (backport 2.0 #39255) - #39257

Merged
mohityadav766 merged 1 commit into
2.0from
backport/2.0/saml-strict-mode-tls-proxy
Nov 30, 2026
Merged

mohityadav766 merged 1 commit into
2.0from
backport/2.0/saml-strict-mode-tls-proxy

Conversation

@mohityadav766

Copy link
Copy Markdown
Member

Describe your changes:

Backport of #39255 to 2.0 (fixes #39253).

With Strict Mode on, every SAML sign-in behind a TLS-terminating load balancer or ingress fails, on the live login and in Test Login, with The response was received at http://<host>/callback instead of https://<host>/callback. java-saml's strict mode compared the response's Destination and Recipient with the URL the request arrived on, which is http:// once TLS ends at the proxy. It now compares them with the configured ACS URL, as SamlResponseValidator.validate already does outside strict mode. A response addressed to any other URL is still rejected.

Since 2.0.8 (#37437), the settings form shows Want Messages/Assertions Signed only while Strict Mode is on, so 2.0 deployments behind a TLS-terminating proxy that want signed responses hit this.

Adapted for 2.0:

Type of change:

  • Bug fix

Tests:

Unit tests

  • Same tests as Fixes #39253: Accept SAML strict-mode sign-ins behind a TLS-terminating proxy #39255: SamlResponseValidatorTest (2 strict-mode cases), SamlAuthServletHandlerTest#handleCallback_strictModeAcceptsAResponseThatATlsTerminatingProxyForwardedOverHttp, TestLoginSamlHandlerTest#strictModeAcceptsAResponseThatATlsTerminatingProxyForwardedOverHttp.
  • On 2.0, both handler tests failed with the message above until the handlers used atConfiguredAcs. With the fix, 18 of the 19 *Saml*Test and TestLogin*Test classes pass locally (208 tests, 0 failures), run on 2.0 at a6e7586. The one commit 2.0 gained since then is UI-only. SamlIdpCertificateMigrationTest was left out: it needs Docker, which was unavailable here, and it does not cover the changed code.

Backend integration tests

  • Not applicable (no backend API changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

🤖 Generated with Claude Code

…ng proxy (backport 2.0 #39255)

With Strict Mode on, java-saml compares a response's Destination and the
Recipient of its bearer SubjectConfirmationData with the URL the request
arrived on. When TLS ends at a load balancer, the server sees the identity
provider's post to the https ACS arrive over http, so every response was
rejected ("The response was received at http://... instead of
https://..."), on the live login and on Test Login.

Both paths now have java-saml compare with the configured ACS URL, the URL
SamlResponseValidator already compares Destination with outside strict
mode. A response addressed to any other URL is still rejected.

2.0's Test Login already installs a response factory that checks the
response answers its request, so atConfiguredAcs wraps that factory's
response. The decision record cites #37437 in place of a record 2.0
does not have.

ADR:2026-11-27-saml-strict-mode-checks-the-configured-acs-url
@mohityadav766
mohityadav766 requested a review from a team as a code owner November 30, 2026 09:13
@mohityadav766
mohityadav766 requested review from harshach and removed request for a team November 30, 2026 09:13
@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 30, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Changing strict SAML response URL validation controls which sign-ins authenticate; a mismatch between the configured ACS and IdP responses could block logins.

Fixes SAML Strict Mode sign-ins behind a TLS-terminating proxy by comparing the response's Destination and Recipient against the configured ACS URL instead of the incoming http:// request URL. Responses addressed to any other URL are still rejected. No issues found.

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

@mohityadav766
mohityadav766 merged commit d52d363 into 2.0 Nov 30, 2026
65 of 67 checks passed
@mohityadav766
mohityadav766 deleted the backport/2.0/saml-strict-mode-tls-proxy branch November 30, 2026 14:55
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