首页>代码>基于Spring Boot、Spring Cloud、Spring Oauth2 和 Spring Cloud Netflix 等框架构建的微服务项目>/spring-boot-cloud/auth-service/src/main/java/cn/zhangxd/auth/config/ResourceServerConfiguration.java
package cn.zhangxd.auth.config; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter; @Configuration @EnableResourceServer public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter { @Override public void configure(HttpSecurity http) throws Exception { http .requestMatchers().antMatchers("/current") .and() .authorizeRequests() .antMatchers("/current").access("#oauth2.hasScope('read')"); } }
最近下载更多
徐万强 LV9
2023年12月12日
iceboard LV2
2023年2月26日
LV6
2022年12月6日
2317696509 LV6
2022年9月2日
樊樊樊樊樊樊阵雨 LV18
2022年8月17日
qianyunjie LV8
2022年5月30日
x646936674 LV10
2022年3月5日
夕阳2266 LV10
2021年11月25日
27866849 LV4
2021年11月10日
十里画纱 LV5
2021年9月15日