use of org.springframework.web.filter.CompositeFilter in project service-authorization by reportportal.
the class OAuthSecurityConfig method configure.
@Override
protected final void configure(HttpSecurity http) throws Exception {
// @formatter:off
http.antMatcher("/**").authorizeRequests().antMatchers(SSO_LOGIN_PATH + "/**", "/webjars/**", "/index.html", "/epam/**", "/info", "/health", "/api-docs/**").permitAll().anyRequest().authenticated().and().csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
CompositeFilter authCompositeFilter = new CompositeFilter();
List<OAuth2ClientAuthenticationProcessingFilter> additionalFilters = ImmutableList.<OAuth2ClientAuthenticationProcessingFilter>builder().addAll(getDefaultFilters(oauth2ClientContext)).addAll(getAdditionalFilters(oauth2ClientContext)).build();
/* make sure filters have correct exception handler */
additionalFilters.forEach(filter -> filter.setAuthenticationFailureHandler(OAUTH_ERROR_HANDLER));
authCompositeFilter.setFilters(additionalFilters);
// install additional OAuth Authentication filters
http.addFilterAfter(authCompositeFilter, BasicAuthenticationFilter.class);
// @formatter:on
}
use of org.springframework.web.filter.CompositeFilter in project vorto by eclipse.
the class SecurityConfiguration method ssoFilter.
private Filter ssoFilter() {
CompositeFilter filter = new CompositeFilter();
filter.setFilters(Arrays.asList(githubFilter(), eidpFilter()));
return filter;
}
Aggregations