I defined my AlanCookieFilter
by @Bean
annotation:
@Bean
public Filter alanCookieFilter() {
return new AlanCookieFilter(); // type of AbstractPreAuthenticatedProcessingFilter
}
Then I added my filter by using WebSecurityConfigurerAdapter
:
@Configuration
public class AlanOAuthWebConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.addFilter(alanCookieFilter()).antMatcher("/**");
}
}
But when I started application, I got following log message:
o.s.b.c.embedded.FilterRegistrationBean : Mapping filter: 'alanCookieFilter' to: [/*]
It seems that AlanCookieFilter
is still mapped to /*
instead of /**
. I'm totally confused by this wield behaviour.