use of org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrations in project midpoint by Evolveum.
the class SamlModuleWebSecurityConfigurer method configure.
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
MidpointSaml2LoginConfigurer configurer = new MidpointSaml2LoginConfigurer<>(auditProvider);
configurer.relyingPartyRegistrationRepository(relyingPartyRegistrations()).loginProcessingUrl(getConfiguration().getPrefixOfModule() + SamlModuleWebSecurityConfiguration.SSO_LOCATION_URL_SUFFIX).successHandler(getObjectPostProcessor().postProcess(new MidPointAuthenticationSuccessHandler())).failureHandler(new MidpointAuthenticationFailureHandler());
try {
configurer.authenticationManager(new ProviderManager(Collections.emptyList(), authenticationManager()));
} catch (Exception e) {
LOGGER.error("Couldn't initialize authentication manager for saml2 module");
}
getOrApply(http, configurer);
Saml2MetadataFilter filter = new Saml2MetadataFilter(new MidpointMetadataRelyingPartyRegistrationResolver(relyingPartyRegistrations()), new OpenSamlMetadataResolver());
filter.setRequestMatcher(new AntPathRequestMatcher(getConfiguration().getPrefixOfModule() + "/metadata/*"));
http.addFilterAfter(filter, Saml2WebSsoAuthenticationFilter.class);
}
use of org.springframework.security.saml2.provider.service.registration.RelyingPartyRegistrations in project midpoint by Evolveum.
the class SamlModuleWebSecurityConfigurer method getLogoutRequestSuccessHandler.
@Override
protected LogoutSuccessHandler getLogoutRequestSuccessHandler() {
RelyingPartyRegistrationResolver registrationResolver = new DefaultRelyingPartyRegistrationResolver(relyingPartyRegistrations());
Saml2LogoutRequestResolver logoutRequestResolver = new MidpointSaml2LogoutRequestResolver(new OpenSaml4LogoutRequestResolver(registrationResolver));
Saml2RelyingPartyInitiatedLogoutSuccessHandler handler = new Saml2RelyingPartyInitiatedLogoutSuccessHandler(logoutRequestResolver);
return getObjectPostProcessor().postProcess(new MidpointSaml2LogoutRequestSuccessHandler(handler));
}
Aggregations