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

using rest_framework.authtoken instead of username and password when getting token #771

Open
will-emmerson opened this issue Dec 11, 2023 · 1 comment
Labels

Comments

@will-emmerson
Copy link

I am already using rest_framework.authtoken in an api, I wondered if it's possible to use this instead of username and password, to then get a time-limited JWT with a certain scope.
I can see that TokenObtainSerializer.validate calls Django's authenticate but rest_framework.authtoken isn't a part of this so it doesn't work. I am not sure the best way to go about this, should I just overwrite TokenObtainSerializer.validate to not call Django's authenticate?

@Andrew-Chen-Wang
Copy link
Member

Just overwrite if you plan on forgoing Django's authenticate function

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