springsecurity 资源服务器

@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
posted @ 2021-08-19 16:46  TIMEAWAY  阅读(203)  评论(0编辑  收藏  举报