登录后/uaa/oauth/token spring 发送该字段:
{
"access_token": "eyJhbG",
"token_type": "bearer",
"refresh_token": "asfasfda"
"expires_in": 86399,
"scope": "events",
"jti": "a4e4584c-ed38-4a26-b778-1748b27046ae",
"key" : "my own field"
}
但是我如何添加自己的自定义字段,例如键?
最佳答案
@Configuration
@EnableResourceServer
protected static class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {
@Override
public void configure(ResourceServerSecurityConfigurer resources) {
resources.resourceId(Constants.RESOURCE_ID);
}
@Override
public void configure(HttpSecurity http) throws Exception {
http
.addFilter(new AuthTokenRequestFilter())
.....
}
}
关于java - Spring oauth2 添加额外的 fieldp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38622240/