Skip to content

How can I inject my own UserDetails or AbstractAuthenticationToken post Authentication? #228

Answered by ch4mpy
virtex-br asked this question in Q&A
Discussion options

You must be logged in to vote

With OAuth2, the "user-service" is the authorization server: that's it which is responsible for providing user data as OAuth2 claims (inside a JWT access token or as introspection response payload for resource servers, and as ID token payload or userinfo response payload for clients). On resource servers and clients, you shouldn't be looping to the DB to get user details & authorities and, more importantly, you should not duplicate this authorization server data in your resource server's DB.

With oauth2ResourceServer and a JWT decoder, the Authentication instance is returned by a Converter<Jwt, AbstractAuthenticationToken>. The default implementation is JwtAuthenticationConverter which bu…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by virtex-br
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants