Configure Spring Security OAuth 2 Response

In my Java application, I use the Spring Security OAuth 2 library to implement the OAuth provider. The response to successful authentication (for grant type authorization_code) looks something like this:

{"access_token": "d179bf70-aa40-4df9-a3e1-440e835c273a", 
"expires_in": "43199", 
"refresh_token": "879e7bd0-5e0f-48a9-b64d-f61d5665bf4e", 
"scope": "read", 
"token_type": "bearer"}

Is there a way to add additional properties to this answer, for example. username or email?

+4
source share
1 answer

Spring OAuth2 OAuth2AccessToken additionalInfo. , , AccessTokenConverter (, , DefaultTokenServices ). , , , ( , ).

+4

Source: https://habr.com/ru/post/1584510/