Search in sources :

Example 1 with CompositeFilter

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
}
Also used : CompositeFilter(org.springframework.web.filter.CompositeFilter) OAuth2ClientAuthenticationProcessingFilter(org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter)

Example 2 with CompositeFilter

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;
}
Also used : CompositeFilter(org.springframework.web.filter.CompositeFilter)

Aggregations

CompositeFilter (org.springframework.web.filter.CompositeFilter)2 OAuth2ClientAuthenticationProcessingFilter (org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter)1