ssoFilter Игнорируется Springboot - PullRequest
0 голосов
/ 18 декабря 2018

Я настроил этот класс и добавил фильтры для входа в социальную сеть Google и Facebook

import static springfox.documentation.builders.PathSelectors.regex;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.Filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerProperties;
import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoTokenServices;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.oauth2.client.OAuth2ClientContext;
import org.springframework.security.oauth2.client.OAuth2RestTemplate;
import org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter;
import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter;
import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails;
import org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeResourceDetails;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CompositeFilter;

import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
@EnableWebSecurity
@EnableOAuth2Client
@Order(200)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    private OAuth2ClientContext oauth2ClientContext;

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Override
    @Autowired
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
    }

    @Bean
    public CorsConfigurationSource corsConfigurationSource() {
        CorsConfiguration configuration = new CorsConfiguration();
        configuration.setAllowedOrigins(Arrays.asList("*"));
        configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"));
        configuration.setAllowedHeaders(Arrays.asList("authorization", "content-type", "x-auth-token"));
        configuration.setExposedHeaders(Arrays.asList("x-auth-token"));
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", configuration);
        return source;
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {
        http.csrf().disable().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);

        http.authorizeRequests().antMatchers(HttpMethod.POST, "/**", "/users/sign-up", "/users/validateUser", "/api/v1/profile").permitAll().antMatchers("/login/facebook").permitAll()
                .antMatchers("/", "/index.html", "/apidocs/index.html", "/api/v1/guest", "/auth/**", "/login/**", "/webjars/**", "/favicon.ico", "/signin/**", "/signup/**",
                        "/api/v1/facebook/callback", "/api/v1/google/callback", "/v2/api-docs", "/swagger-resources/**", "/swagger-ui.html", "/configuration/**", "/swagger-ui.js",
                        "/swagger-ui.min.js", "/api-docs", "/fonts/*", "/api-docs/*", "/api-docs/default/*", "/webjars/**", "/public")
                .permitAll().anyRequest().authenticated();

        http.headers().addHeaderWriter((request, response) -> {
            response.addHeader("Access-Control-Allow-Origin", "*");
            if (request.getMethod().equals("OPTIONS")) {
                response.setHeader("Access-Control-Allow-Methods", request.getHeader("Access-Control-Request-Method"));
                response.setHeader("Access-Control-Allow-Headers", request.getHeader("Access-Control-Request-Headers"));
            }
        });
        http.addFilterBefore(ssoFilter(), UsernamePasswordAuthenticationFilter.class);
    }

    @Bean
    public Docket elizaApi() {
        return new Docket(DocumentationType.SWAGGER_2)//
                .groupName("all").select()//
                .apis(RequestHandlerSelectors.any())//
                .paths(regex("/.*"))//
                .build();
    }

    @Override
    @Bean
    public AuthenticationManager authenticationManagerBean() throws Exception {
        return super.authenticationManagerBean();
    }

    @Bean
    public FilterRegistrationBean<OAuth2ClientContextFilter> oauth2ClientFilterRegistration() {
        FilterRegistrationBean<OAuth2ClientContextFilter> registration = new FilterRegistrationBean<OAuth2ClientContextFilter>();
        registration.setFilter(new OAuth2ClientContextFilter());
        registration.setOrder(-100);
        return registration;
    }

    @Bean
    @ConfigurationProperties("facebook")
    public ClientResources facebook() {
        return new ClientResources();
    }

    @Bean
    @ConfigurationProperties("google")
    public ClientResources google() {
        return new ClientResources();
    }

    private Filter ssoFilter() {
        CompositeFilter filter = new CompositeFilter();

        List<Filter> filters = new ArrayList<>();
        filters.add(ssoFilter(facebook(), "/login/facebook"));
        filters.add(ssoFilter(google(), "/login/google"));
        filter.setFilters(filters);
        return filter;
    }

    private Filter ssoFilter(ClientResources client, String path) {
        OAuth2ClientAuthenticationProcessingFilter filter = new OAuth2ClientAuthenticationProcessingFilter(path);
        OAuth2RestTemplate template = new OAuth2RestTemplate(client.getClient(), oauth2ClientContext);
        filter.setRestTemplate(template);

        UserInfoTokenServices tokenServices = new UserInfoTokenServices(client.getResource().getUserInfoUri(), client.getClient().getClientId());
        tokenServices.setRestTemplate(template);

        filter.setTokenServices(tokenServices);
        return filter;
    }

    @Bean
    public OAuth2RestTemplate oAuth2RestTemplate(OAuth2ProtectedResourceDetails resource) {
        return new OAuth2RestTemplate(resource);
    }

}

class ClientResources {

    @NestedConfigurationProperty
    private AuthorizationCodeResourceDetails client = new AuthorizationCodeResourceDetails();

    @NestedConfigurationProperty
    private ResourceServerProperties resource = new ResourceServerProperties();

    public AuthorizationCodeResourceDetails getClient() {
        return client;
    }

    public ResourceServerProperties getResource() {
        return resource;
    }
}

, но я вижу, когда я звоню POST http://localhost:8080/login/facebook (на локальном сервере), он не может достичьслужбы и возвращает

Страница ошибки Whitelabel

Это приложение не имеет явного сопоставления для / error, поэтому вы видите это как запасной вариант.Вт дек 18 13:24:09 EET 2018 Произошла непредвиденная ошибка (тип = Не найдено, статус = 404).Нет доступных сообщений

Вот журналы на стороне сервера:

2018-12-18 13:31:03.340 DEBUG 5045 --- [nio-8101-exec-7] .s.o.p.e.FrameworkEndpointHandlerMapping : Looking up handler method for path /login/facebook
2018-12-18 13:31:03.340 DEBUG 5045 --- [nio-8101-exec-7] .s.o.p.e.FrameworkEndpointHandlerMapping : Did not find handler method for [/login/facebook]
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/token']
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login/facebook'; against '/oauth/token'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/token_key']
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login/facebook'; against '/oauth/token_key'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/check_token']
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login/facebook'; against '/oauth/check_token'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 1 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 3 of 12 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 4 of 12 in additional filter chain; firing Filter: 'CorsFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 5 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', GET]
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /login/facebook' doesn't match 'GET /logout
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', POST]
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login/facebook'; against '/logout'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', PUT]
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /login/facebook' doesn't match 'PUT /logout
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', DELETE]
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /login/facebook' doesn't match 'DELETE /logout
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 6 of 12 in additional filter chain; firing Filter: 'OAuth2AuthenticationProcessingFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.o.p.a.BearerTokenExtractor         : Token not found in headers. Trying request parameters.
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.o.p.a.BearerTokenExtractor         : Token not found in request parameters.  Not an OAuth2 request.
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] p.a.OAuth2AuthenticationProcessingFilter : No token in request, will continue chain.
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2018-12-18 13:31:03.341 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.AnonymousAuthenticationFilter  : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@8728c140: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request '/login/facebook' matched by universal pattern '/**'
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor    : Secure object: FilterInvocation: URL: /login/facebook; Attributes: [#oauth2.throwOnError(permitAll)]
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor    : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@8728c140: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.access.vote.AffirmativeBased       : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@365585ff, returned: 1
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor    : Authorization successful
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor    : RunAsManager did not change Authentication object
2018-12-18 13:31:03.342 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /login/facebook reached end of additional filter chain; proceeding with original chain
2018-12-18 13:31:03.345 DEBUG 5045 --- [nio-8101-exec-7] .s.o.p.e.FrameworkEndpointHandlerMapping : Looking up handler method for path /login/facebook
2018-12-18 13:31:03.345 DEBUG 5045 --- [nio-8101-exec-7] .s.o.p.e.FrameworkEndpointHandlerMapping : Did not find handler method for [/login/facebook]
2018-12-18 13:31:03.352 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.header.writers.HstsHeaderWriter  : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@34e2e224
2018-12-18 13:31:03.353 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.ExceptionTranslationFilter     : Chain processed normally
2018-12-18 13:31:03.353 DEBUG 5045 --- [nio-8101-exec-7] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/token']
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/error'; against '/oauth/token'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/token_key']
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/error'; against '/oauth/token_key'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/check_token']
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/error'; against '/oauth/check_token'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 1 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 3 of 12 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 4 of 12 in additional filter chain; firing Filter: 'CorsFilter'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 5 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', GET]
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /error' doesn't match 'GET /logout
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', POST]
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/error'; against '/logout'
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', PUT]
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /error' doesn't match 'PUT /logout
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/logout', DELETE]
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.u.matcher.AntPathRequestMatcher  : Request 'POST /error' doesn't match 'DELETE /logout
2018-12-18 13:31:03.354 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.web.util.matcher.OrRequestMatcher  : No matches found
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 6 of 12 in additional filter chain; firing Filter: 'OAuth2AuthenticationProcessingFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.o.p.a.BearerTokenExtractor         : Token not found in headers. Trying request parameters.
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.o.p.a.BearerTokenExtractor         : Token not found in request parameters.  Not an OAuth2 request.
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] p.a.OAuth2AuthenticationProcessingFilter : No token in request, will continue chain.
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.AnonymousAuthenticationFilter  : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@8728c140: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2018-12-18 13:31:03.355 DEBUG 5045 --- [nio-8101-exec-7] o.s.security.web.FilterChainProxy        : /error reached end of additional filter chain; proceeding with original chain
2018-12-18 13:31:03.363 DEBUG 5045 --- [nio-8101-exec-7] o.s.s.w.a.ExceptionTranslationFilter     : Chain processed normally
2018-12-18 13:31:03.363 DEBUG 5045 --- [nio-8101-exec-7] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
...