Soo*_*Koh 5 spring-boot spring-security-oauth2 spring-cloud
作为标题,版本1.1中没有@ EnableOAuth2Resource.我怎样才能在1.1中实现同样的目标?
从我在https://github.com/spring-cloud/spring-cloud-security中读到的内容来看,Spring Cloud 1.1中没有@ EnableOAuth2Resource注释.您只需使用Spring OAuth中的常规@EnableResourecServer即可.
在我更新到1.1之前,我可以使用@ EnableOAuth2Resource通过在属性文件中提供userInfoUri来检查来自另一个Auth服务器的令牌.它工作正常,直到我更新版本.
spring:
oauth2:
resource:
userInfoUri: http://auth:9003/api/me
preferTokenInfo: false
Run Code Online (Sandbox Code Playgroud)
在我更新到1.1后,我只是将@ EnableOAuth2Resource更改为@EnableResourceServer.但是,当我调用受保护的api时,它显示无效的访问令牌.
| 归档时间: |
|
| 查看次数: |
1111 次 |
| 最近记录: |