我用boot和oauth2开始了一个新项目。我将client_credentials设置为grant_type with refresh_token但是只得到access_token而不是刷新。
这是我的clientDetailsServiceConfigurer:
.withClient("XXXXX")
.authorizedGrantTypes("client_credentials", "refresh_token")
.authorities(ROLE_PRODUCER)
.scopes(SCOPE_WRITE)
.resourceIds(RESOURCE_ID)
.secret("WSEWEWEWEW")
.accessTokenValiditySeconds(7200);
服务器的响应:
{"access_token":"XXXX","token_type":"bearer","expires_in":6901,"scope":"write"}