Repository navigation
Spring Security parity — Tier 5b: SAML2 single sign-on (SP side). The
Service-Provider half of the SAML 2.0 Web-Browser-SSO profile — Spring's
saml2Login() — delegating XML-signature verification to samael and adding a
Spring-faithful, hardened wrapper. Opt-in saml2 feature; the default build is
unaffected. Adversarially reviewed before release.
Added
saml2feature (opt-in, pulls insamael+ a systemlibxml2/xmlsec1
/ OpenSSL):RelyingPartyRegistration+ builder +InMemoryRelyingPartyRegistrationRepository
(Spring'sRelyingPartyRegistration/ repository) — configured from IdP
metadata XML or explicit asserting-party details.- SP-initiated
AuthnRequest—authn_request_redirect(HTTP-Redirect
binding) +Saml2AuthenticationRequestRepository(TTL'd outgoing
request-id store forInResponseTomatching). authenticate— verifies a POST-binding SAMLResponse(signature +
audience / recipient /InResponseTo/ status / time conditions, via
samael) and maps theNameID+ configured attributes to an
Authentication(Spring'sOpenSaml4AuthenticationProvider).metadata_xml— SP metadata generation (Spring'sSaml2MetadataFilter).AssertionReplayCache+InMemoryAssertionReplayCache— one-time-use
assertion replay protection.
Security
- Fail-closed on a missing IdP signing certificate: building a registration
is rejected when the asserting party has no signing cert, becausesamael
would otherwise skip signature verification entirely (an authentication bypass). - Signature-algorithm allow-list pinned to SHA-256+ RSA/ECDSA by default
(samaelotherwise accepts all algorithms — an algorithm-substitution risk). - One-time-use replay protection the SAML profile requires but
samaeldoes
not track; size-bounded response decoding; and all native XML-Security
calls are serialized (the stack is not concurrency-safe).
Notes
- Single-logout, signed
AuthnRequests, and encrypted assertions are follow-ups. - Verification correctness rests on
samael(whose own crypto suite covers
accept/reject of XML signatures); this module's registration, mapping, replay,
and rejection logic are unit-tested. Thesaml2feature's tests require the
XML-Security system libraries and so run only when the feature is enabled.