Search in sources :

Example 6 with MidpointAuthenticationFailureHandler

use of com.evolveum.midpoint.authentication.impl.handler.MidpointAuthenticationFailureHandler in project midpoint by Evolveum.

the class SecurityQuestionsFormModuleWebSecurityConfigurer method configure.

@Override
protected void configure(HttpSecurity http) throws Exception {
    super.configure(http);
    http.antMatcher(AuthUtil.stripEndingSlashes(getPrefix()) + "/**");
    getOrApply(http, new MidpointFormLoginConfigurer<>(new SecurityQuestionsAuthenticationFilter())).loginPage("/securityquestions").loginProcessingUrl(AuthUtil.stripEndingSlashes(getPrefix()) + "/spring_security_login").failureHandler(new MidpointAuthenticationFailureHandler()).successHandler(getObjectPostProcessor().postProcess(new MidPointAuthenticationSuccessHandler())).permitAll();
    getOrApply(http, new MidpointExceptionHandlingConfigurer<>()).authenticationEntryPoint(new WicketLoginUrlAuthenticationEntryPoint("/securityquestions"));
    http.logout().clearAuthentication(true).logoutRequestMatcher(getLogoutMatcher(http, getPrefix() + "/logout")).invalidateHttpSession(true).deleteCookies("JSESSIONID").logoutSuccessHandler(createLogoutHandler());
}
Also used : MidPointAuthenticationSuccessHandler(com.evolveum.midpoint.authentication.impl.handler.MidPointAuthenticationSuccessHandler) MidpointFormLoginConfigurer(com.evolveum.midpoint.authentication.impl.filter.configurers.MidpointFormLoginConfigurer) MidpointAuthenticationFailureHandler(com.evolveum.midpoint.authentication.impl.handler.MidpointAuthenticationFailureHandler) SecurityQuestionsAuthenticationFilter(com.evolveum.midpoint.authentication.impl.filter.SecurityQuestionsAuthenticationFilter) WicketLoginUrlAuthenticationEntryPoint(com.evolveum.midpoint.authentication.impl.entry.point.WicketLoginUrlAuthenticationEntryPoint) MidpointExceptionHandlingConfigurer(com.evolveum.midpoint.authentication.impl.filter.configurers.MidpointExceptionHandlingConfigurer)

Aggregations

MidPointAuthenticationSuccessHandler (com.evolveum.midpoint.authentication.impl.handler.MidPointAuthenticationSuccessHandler)6 MidpointAuthenticationFailureHandler (com.evolveum.midpoint.authentication.impl.handler.MidpointAuthenticationFailureHandler)6 WicketLoginUrlAuthenticationEntryPoint (com.evolveum.midpoint.authentication.impl.entry.point.WicketLoginUrlAuthenticationEntryPoint)3 MidpointExceptionHandlingConfigurer (com.evolveum.midpoint.authentication.impl.filter.configurers.MidpointExceptionHandlingConfigurer)3 ProviderManager (org.springframework.security.authentication.ProviderManager)2 AuthenticationChannel (com.evolveum.midpoint.authentication.api.AuthenticationChannel)1 MailNonceAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.MailNonceAuthenticationFilter)1 MidpointRequestHeaderAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.MidpointRequestHeaderAuthenticationFilter)1 SecurityQuestionsAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.SecurityQuestionsAuthenticationFilter)1 MidpointFormLoginConfigurer (com.evolveum.midpoint.authentication.impl.filter.configurers.MidpointFormLoginConfigurer)1 OidcLoginConfigurer (com.evolveum.midpoint.authentication.impl.oidc.OidcLoginConfigurer)1 MidpointMetadataRelyingPartyRegistrationResolver (com.evolveum.midpoint.authentication.impl.saml.MidpointMetadataRelyingPartyRegistrationResolver)1 MidpointSaml2LoginConfigurer (com.evolveum.midpoint.authentication.impl.saml.MidpointSaml2LoginConfigurer)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Authentication (org.springframework.security.core.Authentication)1 OpenSamlMetadataResolver (org.springframework.security.saml2.provider.service.metadata.OpenSamlMetadataResolver)1 Saml2MetadataFilter (org.springframework.security.saml2.provider.service.web.Saml2MetadataFilter)1 AntPathRequestMatcher (org.springframework.security.web.util.matcher.AntPathRequestMatcher)1