use of eu.bcvsolutions.idm.core.security.api.auth.filter.AuthenticationFilter in project CzechIdMng by bcvsolutions.
the class WebSecurityConfig method configure.
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable();
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
//
AuthenticationFilter authenticationFilter = authenticationFilter();
Set<RequestMatcher> publicPaths = authenticationFilter.getPublicPathRequestMatchers();
//
http.addFilterBefore(requestContextFilter(), BasicAuthenticationFilter.class).addFilterBefore(startUserTransactionFilter(), BasicAuthenticationFilter.class).addFilterAfter(authenticationFilter, BasicAuthenticationFilter.class).addFilterAfter(extendExpirationFilter(), BasicAuthenticationFilter.class).authorizeRequests().expressionHandler(expressionHandler()).antMatchers(HttpMethod.OPTIONS).permitAll().requestMatchers(publicPaths.toArray(new RequestMatcher[publicPaths.size()])).permitAll().antMatchers(BaseDtoController.BASE_PATH + "/**").fullyAuthenticated().anyRequest().permitAll();
}
Aggregations