Search in sources :

Example 1 with HttpSecurityQuestionsAuthenticationEntryPoint

use of com.evolveum.midpoint.authentication.impl.entry.point.HttpSecurityQuestionsAuthenticationEntryPoint in project midpoint by Evolveum.

the class HttpSecurityQuestionsModuleWebSecurityConfigurer method configure.

@Override
protected void configure(HttpSecurity http) throws Exception {
    super.configure(http);
    HttpAuthenticationEntryPoint entryPoint = getObjectPostProcessor().postProcess(new HttpSecurityQuestionsAuthenticationEntryPoint());
    http.antMatcher(AuthUtil.stripEndingSlashes(getPrefix()) + "/**");
    http.authorizeRequests().accessDecisionManager(new MidpointHttpAuthorizationEvaluator(securityEnforcer, securityContextManager, taskManager, model));
    HttpSecurityQuestionsAuthenticationFilter filter = getObjectPostProcessor().postProcess(new HttpSecurityQuestionsAuthenticationFilter(authenticationManager(), entryPoint));
    RememberMeServices rememberMeServices = http.getSharedObject(RememberMeServices.class);
    if (rememberMeServices != null) {
        filter.setRememberMeServices(rememberMeServices);
    }
    http.addFilterAt(filter, BasicAuthenticationFilter.class);
    http.formLogin().disable().csrf().disable();
    getOrApply(http, new MidpointExceptionHandlingConfigurer<>()).authenticationEntryPoint(entryPoint).authenticationTrustResolver(new MidpointAuthenticationTrustResolverImpl());
}
Also used : HttpSecurityQuestionsAuthenticationEntryPoint(com.evolveum.midpoint.authentication.impl.entry.point.HttpSecurityQuestionsAuthenticationEntryPoint) MidpointAuthenticationTrustResolverImpl(com.evolveum.midpoint.authentication.impl.MidpointAuthenticationTrustResolverImpl) RememberMeServices(org.springframework.security.web.authentication.RememberMeServices) HttpSecurityQuestionsAuthenticationFilter(com.evolveum.midpoint.authentication.impl.filter.HttpSecurityQuestionsAuthenticationFilter) HttpAuthenticationEntryPoint(com.evolveum.midpoint.authentication.impl.entry.point.HttpAuthenticationEntryPoint) MidpointHttpAuthorizationEvaluator(com.evolveum.midpoint.authentication.impl.authorization.evaluator.MidpointHttpAuthorizationEvaluator)

Aggregations

MidpointAuthenticationTrustResolverImpl (com.evolveum.midpoint.authentication.impl.MidpointAuthenticationTrustResolverImpl)1 MidpointHttpAuthorizationEvaluator (com.evolveum.midpoint.authentication.impl.authorization.evaluator.MidpointHttpAuthorizationEvaluator)1 HttpAuthenticationEntryPoint (com.evolveum.midpoint.authentication.impl.entry.point.HttpAuthenticationEntryPoint)1 HttpSecurityQuestionsAuthenticationEntryPoint (com.evolveum.midpoint.authentication.impl.entry.point.HttpSecurityQuestionsAuthenticationEntryPoint)1 HttpSecurityQuestionsAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.HttpSecurityQuestionsAuthenticationFilter)1 RememberMeServices (org.springframework.security.web.authentication.RememberMeServices)1