Repository navigation
Fixes #39253: Accept SAML strict-mode sign-ins behind a TLS-terminating proxy (backport 2.0 #39255) - #39257
Conversation
…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
❌ 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 |
Code Review ✅ Approved 🔴 High riskChanging 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 VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
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'sDestinationandRecipientwith the URL the request arrived on, which ishttp://once TLS ends at the proxy. It now compares them with the configured ACS URL, asSamlResponseValidator.validatealready 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:
atConfiguredAcswraps that factory's response instead of adding the separate factory main needed.complete().ADR:2026-11-10-saml-security-settings-mean-what-the-form-shows, which is not on 2.0.Type of change:
Tests:
Unit tests
SamlResponseValidatorTest(2 strict-mode cases),SamlAuthServletHandlerTest#handleCallback_strictModeAcceptsAResponseThatATlsTerminatingProxyForwardedOverHttp,TestLoginSamlHandlerTest#strictModeAcceptsAResponseThatATlsTerminatingProxyForwardedOverHttp.atConfiguredAcs. With the fix, 18 of the 19*Saml*TestandTestLogin*Testclasses pass locally (208 tests, 0 failures), run on 2.0 at a6e7586. The one commit 2.0 gained since then is UI-only.SamlIdpCertificateMigrationTestwas left out: it needs Docker, which was unavailable here, and it does not cover the changed code.Backend integration tests
Playwright (UI) tests
🤖 Generated with Claude Code