资源服务器不像认证服务器可以直接配置 ,资源服务器只能配置每个接口权限
http.sessionManagement()
// SpringSecurity不会使用也不会创建HttpSession实例
.sessionCreationPolicy(SessionCreationPolicy.STATELESS).and().authorizeRequests()
// swagger请求
.antMatchers("/swagger-ui.html", "/webjars/**", "/swagger-resources/**","/v2/**").permitAll()
// 所有请求,都需要有all范围(scope)
.antMatchers("/**").access("#oauth2.hasScope('xxx')").anyRequest().authenticated().and().csrf()
.disable();