Search in sources :

Example 1 with MidpointAuthenticationTrustResolverImpl

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

the class MidpointWebSecurityConfigurerAdapter method configure.

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.setSharedObject(AuthenticationTrustResolverImpl.class, new MidpointAuthenticationTrustResolverImpl());
    http.addFilter(new WebAsyncManagerIntegrationFilter()).sessionManagement().and().securityContext();
    http.apply(new AuthFilterConfigurer());
    createSessionContextRepository(http);
    http.sessionManagement().maximumSessions(-1).sessionRegistry(sessionRegistry).maxSessionsPreventsLogin(true);
}
Also used : MidpointAuthenticationTrustResolverImpl(com.evolveum.midpoint.authentication.impl.MidpointAuthenticationTrustResolverImpl) WebAsyncManagerIntegrationFilter(org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter) AuthFilterConfigurer(com.evolveum.midpoint.authentication.impl.filter.configurers.AuthFilterConfigurer)

Example 2 with MidpointAuthenticationTrustResolverImpl

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

the class ModuleWebSecurityConfigurer method configure.

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.setSharedObject(AuthenticationTrustResolver.class, new MidpointAuthenticationTrustResolverImpl());
    http.authorizeRequests().accessDecisionManager(accessDecisionManager).anyRequest().fullyAuthenticated();
    getOrApply(http, new MidpointExceptionHandlingConfigurer<>()).accessDeniedHandler(accessDeniedHandler).authenticationTrustResolver(new MidpointAuthenticationTrustResolverImpl());
    http.headers().and().requestCache().and().anonymous().authenticationFilter(createAnonymousFilter()).and().servletApi();
    http.addFilterAfter(new RedirectForLoginPagesWithAuthenticationFilter(), CsrfFilter.class);
    http.csrf();
    if (!csrfEnabled) {
        http.csrf().disable();
    }
    http.headers().disable();
    http.headers().frameOptions().sameOrigin();
}
Also used : MidpointAuthenticationTrustResolverImpl(com.evolveum.midpoint.authentication.impl.MidpointAuthenticationTrustResolverImpl) RedirectForLoginPagesWithAuthenticationFilter(com.evolveum.midpoint.authentication.impl.filter.RedirectForLoginPagesWithAuthenticationFilter)

Example 3 with MidpointAuthenticationTrustResolverImpl

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

the class HttpBasicModuleWebSecurityConfigurer method configure.

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

Example 4 with MidpointAuthenticationTrustResolverImpl

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

the class HttpClusterModuleWebSecurityConfigurer method configure.

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

Example 5 with MidpointAuthenticationTrustResolverImpl

use of com.evolveum.midpoint.authentication.impl.MidpointAuthenticationTrustResolverImpl 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)6 HttpAuthenticationEntryPoint (com.evolveum.midpoint.authentication.impl.entry.point.HttpAuthenticationEntryPoint)4 RememberMeServices (org.springframework.security.web.authentication.RememberMeServices)4 MidpointHttpAuthorizationEvaluator (com.evolveum.midpoint.authentication.impl.authorization.evaluator.MidpointHttpAuthorizationEvaluator)3 MidpointAllowAllAuthorizationEvaluator (com.evolveum.midpoint.authentication.impl.authorization.evaluator.MidpointAllowAllAuthorizationEvaluator)1 HttpSecurityQuestionsAuthenticationEntryPoint (com.evolveum.midpoint.authentication.impl.entry.point.HttpSecurityQuestionsAuthenticationEntryPoint)1 HttpBasicAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.HttpBasicAuthenticationFilter)1 HttpClusterAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.HttpClusterAuthenticationFilter)1 HttpSecurityQuestionsAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.HttpSecurityQuestionsAuthenticationFilter)1 RedirectForLoginPagesWithAuthenticationFilter (com.evolveum.midpoint.authentication.impl.filter.RedirectForLoginPagesWithAuthenticationFilter)1 AuthFilterConfigurer (com.evolveum.midpoint.authentication.impl.filter.configurers.AuthFilterConfigurer)1 OidcBearerTokenAuthenticationFilter (com.evolveum.midpoint.authentication.impl.oidc.OidcBearerTokenAuthenticationFilter)1 WebAsyncManagerIntegrationFilter (org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter)1