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

Authentication with JWT is not fully stateless #835

Closed
922tech opened this issue Dec 14, 2024 · 2 comments
Closed

Authentication with JWT is not fully stateless #835

922tech opened this issue Dec 14, 2024 · 2 comments

Comments

@922tech
Copy link

922tech commented Dec 14, 2024

In rest_framework_simplejwt.authentication.JWTAuthentication.authenticate there is a line like this:

return self.get_user(validated_token), validated_token

Even if the user's request has the valid credentials(the JWT) in the header, this line does not authenticate the user and responds with status code 401(see the picture).
This can be a problem when you have the user data in another service's database.
Is that OK to override authenticate method somehow that it would no longer require the users' database table?

image

@AlexanderNeilson
Copy link

AlexanderNeilson commented Dec 14, 2024 via email

@922tech
Copy link
Author

922tech commented Dec 14, 2024

Thanks!
using rest_framework_simplejwt.authentication.JWTStatelessUserAuthentication did solve my problem.

@922tech 922tech closed this as completed Dec 14, 2024
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

No branches or pull requests

2 participants