Answer the question
In order to leave comments, you need to log in
How to use jwt tokens in django-oauth-toolkit without adding them to the database?
I've been working on separating the auth server from the resource server using django-oauth-toolkit.
I also wrote my jwt token generator:
from rest_framework_simplejwt.tokens import RefreshToken
def my_acces_token_generator(request, refresh_token=False):
refresh = RefreshToken.for_user(request.user)
return str(refresh.access_token)
def my_refresh_token_generator(request, refresh_token=False):
refresh = RefreshToken.for_user(request.user)
return str(refresh)
Answer the question
In order to leave comments, you need to log in
I don’t know about drf, but it seems that refresh token is imported in your code, and it itself should be stored somewhere. In theory, you need to abandon the refresh and use only the access token, apparently you need to import it , and then do something with it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question