diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java index bbf448a394..914d46f8ba 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/saml2/Saml2LogoutConfigurer.java @@ -270,12 +270,14 @@ public final class Saml2LogoutConfigurer> return postProcess(logoutResponseFilter); } - private LogoutFilter createRelyingPartyLogoutFilter(RelyingPartyRegistrationRepository registrations) { + private Saml2RelyingPartyInitiatedLogoutFilter createRelyingPartyLogoutFilter( + RelyingPartyRegistrationRepository registrations) { LogoutHandler[] logoutHandlers = this.logoutHandlers.toArray(new LogoutHandler[0]); Saml2RelyingPartyInitiatedLogoutSuccessHandler logoutRequestSuccessHandler = createSaml2LogoutRequestSuccessHandler( registrations); logoutRequestSuccessHandler.setLogoutRequestRepository(this.logoutRequestConfigurer.logoutRequestRepository); - LogoutFilter logoutFilter = new LogoutFilter(logoutRequestSuccessHandler, logoutHandlers); + Saml2RelyingPartyInitiatedLogoutFilter logoutFilter = new Saml2RelyingPartyInitiatedLogoutFilter( + logoutRequestSuccessHandler, logoutHandlers); logoutFilter.setLogoutRequestMatcher(createLogoutMatcher()); return postProcess(logoutFilter); } @@ -523,4 +525,12 @@ public final class Saml2LogoutConfigurer> } + private static class Saml2RelyingPartyInitiatedLogoutFilter extends LogoutFilter { + + Saml2RelyingPartyInitiatedLogoutFilter(LogoutSuccessHandler logoutSuccessHandler, LogoutHandler... handlers) { + super(logoutSuccessHandler, handlers); + } + + } + }