Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UserDetails from JWT claims #10

Closed
jkerak opened this issue Oct 26, 2016 · 1 comment
Closed

Create UserDetails from JWT claims #10

jkerak opened this issue Oct 26, 2016 · 1 comment
Labels

Comments

@jkerak
Copy link

jkerak commented Oct 26, 2016

If I understand the code correctly in JwtAuthenticationTokenFilter, on every request for data from the api, a database call is made to build the UserDetails, based on username. Would it not be better create the UserDetails based on the claims as parsed from the JWT?

Cheers,

Jim

szerhusenBC added a commit that referenced this issue Oct 28, 2016
@szerhusenBC
Copy link
Owner

You're right. You're solution would also work and make the database calls unnecessary. In other scenarios it could be necessary to load more information than it is present in the token. Because this is just a demo I leave it as it is, but I mention your comment in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants