Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long does it take for a Djoser access token until expire?

Tags:

django

djoser

So Djoser JWT provided an access token when you login, how long until that token expires?

like image 234
Melly Avatar asked Nov 17 '25 05:11

Melly


1 Answers

You have to provide the value in the settings. I use the below configuration. 10 minutes is probably better for the access token.

SIMPLE_JWT = {
    'ACCESS_TOKEN_LIFETIME': timedelta(minutes=5),
    'REFRESH_TOKEN_LIFETIME': timedelta(minutes=360),
}

Check out the simplejwt docs here https://django-rest-framework-simplejwt.readthedocs.io/en/latest/settings.html#access-token-lifetime

like image 170
FlatEarthApproximation Avatar answered Nov 20 '25 03:11

FlatEarthApproximation