DEV Community

Discussion on: How to secure Spring boot REST API endpoints with Amazon Cognito

Collapse
 
shebinhere profile image
Shebin • Edited

Thanks for this. Much appreciated.

I have a question though. How to know which user is accessing the API from the JWT token? I can see there is a field named "username" in the JWT body. Should I rely on that to map the authenticated user to the DB I have? Also how can I support roles and granted authorities?