0
試圖讓我的WebSecurityConfigurerAdapter將某些過濾器放置在「/ secured /」上下文中,然後其他URL不在這些過濾器後面。Spring Security WebSecurityConfig需要安全區域和不安全區域
這裏是我到目前爲止,但一切都打到TokenFilter
protected void configure(HttpSecurity http) throws Exception {
http.antMatcher("/secured/**").addFilterBefore(new TokenAuthenticationFilter(tokenAuthService, environment),
ExceptionTranslationFilter.class).
addFilterBefore(new RequestContentBufferFilter(), TokenAuthenticationFilter.class)
.antMatcher("/**").anonymous()
.and().csrf().disable();
}
任何幫助嗎?