I’m working on migrating my existing saml Single Sign On feature from the saml-extensions library to the new Saml 2.0 framework.
I’ve implemented the login feature via saml with the new library, and currently working on Single logout.
I’ve configured my Asserting party for Single Logout. When I logout from my application, the ‘{applicationUrl}/saml/logout’ is called. But instead of redirecting to the Asserting party url mentioned in my IDP metadata for single logout, the ‘/saml/logout’ call results in the 404 error, and no further SLO workflow takes place. I’ve tried so many configurations over the last 2 days, but nothing has worked.
My SecurityConfiguration :-
@Configuration
@EnableWebSecurity
public class SecurityConfiguration {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
RelyingPartyRegistrationResolver registrationResolver = new DefaultRelyingPartyRegistrationResolver(MyRelyingPartyRegistrationRepository.getInstance());
Saml2MetadataFilter filter = new Saml2MetadataFilter(registrationResolver, new OpenSamlMetadataResolver());
http
.csrf(csrf -> csrf.disable())
.headers().frameOptions().sameOrigin().and()
.addFilterBefore(new SamlExtensionUrlForwardingFilter(), DisableEncodeUrlFilter.class)
.addFilterBefore(filter, Saml2WebSsoAuthenticationFilter.class)
.authorizeHttpRequests((authorize) -> authorize
.antMatchers(HttpMethod.GET,"/logout/saml2/slo").permitAll()
.antMatchers("/saml/**").permitAll()
)
.saml2Login().relyingPartyRegistrationRepository(MyRelyingPartyRegistrationRepository.getInstance())
.successHandler(new MyAuthenticationSuccessHandler())
.and()
.saml2Logout().logoutUrl("/saml/logout");
return http.build();
}
}
Request help with why ‘/saml/logout’ url resource is not being found, resulting in the 404 error.