Spring oauth2.0 resourceId 不更新问题?

项目中使用Spring oauth2.0,现在需要增加一个服务 pay-center,在 oauth_client_details 表中的字段 resoure_id 增加了这个服务

可之前生成的 token 存储的 auth 信息没有这个pay-center 导致这个服务的所有接口都是未授权

{
    "error": "access_denied",
    "error_description": "Invalid token does not contain resource id (pay-center)"
}

使用 oauth 提供的刷新也是没有更新这个缓存

/oauth/token?client_id=client_id&client_secret=secret&grant_type=refresh_token&refresh_token=xxxxxx

箭头所指的缓存一直不能更新,没有 pay-center 这个服务
image.png

阅读 2k
1 个回答

那这就要看你资源服务器怎么去校验token的,你要是自己去认证服务去调用check_token的话,响应结果中自己加数据,解析也同样的处理,jwt的话,生成jwt的时候,扩展jwt信息就行了