@Configuration public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter { @Override public void configure(ResourceServerSecurityConfigurer resources) throws Exception { resources.resourceId("account"); } @Override public void configure(HttpSecurity http) throws Exception { http.antMatcher("/v2/**").csrf().disable() .headers(c->{ c.disable(); }).authorizeRequests().anyRequest().authenticated(); } }
过滤器
OAuth2AuthenticationProcessingFilter