刷新访问令牌后,Spring OAuth2刷新令牌将更改 [英] Spring OAuth2 refresh token to change after refreshing access token
问题描述
我创建了一个身份验证服务器和资源服务器,它们都可以正常工作,唯一的问题是刷新令牌,我希望使用 grant_type调用
,但是spring返回相同的刷新令牌. POST/oauth/token
后更改它= refresh_token
I created an authentication server and resource server, both are working ok, the only problem is with refresh token, I would like it to change after calling POST /oauth/token
with grant_type=refresh_token
, however, spring returns same refresh token.
我想知道在调用oauth端点刷新访问令牌时是否有一种方法来获取新的刷新令牌?
I am wondering if there is a way to get a new refresh token when calling oauth endpoint to refresh access token?
推荐答案
通过查看您应该以某种方式将 reuseRefreshToken
标志设置为 false
.您可以在您的 AuthorizationServerConfigurerAdapter
实现中做到这一点:
You should somehow set the reuseRefreshToken
flag to false
. You can do that in your AuthorizationServerConfigurerAdapter
implementation:
@Configuration
@EnableAuthorizationServer
public class AuthorizationServer extends AuthorizationServerConfigurerAdapter {
// Other methods
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints
.reuseRefreshTokens(false);
}
}
这篇关于刷新访问令牌后,Spring OAuth2刷新令牌将更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!