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

JWT token with public/private key #58

Closed
sverhoeven opened this issue Mar 13, 2023 · 0 comments · Fixed by #73
Closed

JWT token with public/private key #58

sverhoeven opened this issue Mar 13, 2023 · 0 comments · Fixed by #73

Comments

@sverhoeven
Copy link
Member

A web application calling this web service needs to know the same secret as the web service to verify the signature of the JWT token.

We should switch from HS256 JWT algorithm to RS256. RS256 has private/public key pair so the web service creating the tokens needs the private key and the web service that wants to verify the token only needs the public key.

See https://fastapi-users.github.io/fastapi-users/10.4/configuration/authentication/strategies/jwt/?h=rs256#rs256-example

The public key could be made available to consumer via a JSON Web Key Set at GET /.well-known/jwks.json route.

If #54 is fixed then this web service would only need to verify tokens. The user management service should create tokens.

@sverhoeven sverhoeven mentioned this issue Jul 18, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant