From ef76ba040d02b4bb34fe1a1cea8cd405426ee67e Mon Sep 17 00:00:00 2001 From: Josh Cummings <3627351+jzheaux@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:45:23 -0600 Subject: [PATCH] Require non-null authenticationRequest Closes gh-18880 Signed-off-by: Josh Cummings <3627351+jzheaux@users.noreply.github.com> --- .../service/web/CacheSaml2AuthenticationRequestRepository.java | 1 + 1 file changed, 1 insertion(+) diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/CacheSaml2AuthenticationRequestRepository.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/CacheSaml2AuthenticationRequestRepository.java index 675103c029..b4bab13d01 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/CacheSaml2AuthenticationRequestRepository.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/web/CacheSaml2AuthenticationRequestRepository.java @@ -52,6 +52,7 @@ public final class CacheSaml2AuthenticationRequestRepository @Override public void saveAuthenticationRequest(AbstractSaml2AuthenticationRequest authenticationRequest, HttpServletRequest request, HttpServletResponse response) { + Assert.notNull(authenticationRequest, "authenticationRequest must not be null"); String relayState = request.getParameter(Saml2ParameterNames.RELAY_STATE); Assert.notNull(relayState, "relayState must not be null"); this.cache.put(relayState, authenticationRequest);