JSON Web Tokens (JWTs) Refresh tokens

156 views
Skip to first unread message

Caleb Pineur

unread,
Jun 26, 2016, 2:31:26 AM6/26/16
to Django REST framework
All the articles and stack overflow answers I read about JWTs recommend the two token approach.
A short lived (5-10min) access token that is used to access protected resources and a longer lived refresh token
that is used to get more access tokens. I see that the https://github.com/GetBlimp/django-rest-framework-jwt package
is linked in the authentication docs, but this package does not support refresh tokens.

My question is how would one support a 'remember me' functionality (aka not have to sign in after not using the SPA
for just a few min) with Django Rest Framework?

As an aside, since JSON Web Tokens seem to be taking off, is there a chance DRF will natively support them in the future?

yar...@sureapp.com

unread,
Jul 10, 2016, 8:31:04 AM7/10/16
to Django REST framework
Using JWT, what would be the reasoning behind refresh token at all or have any expiration?
JWT allows you to have no storage on server side for tokens. so there is no reason why a token would be invalidated/expire.
I like to look at a JWT as an id badge signed by the server. so there would be no reason to expire that because the authority that signs the badge is authenticated by its signature.

But, thats my opinion. am I missing a benefit that expiration gives?

Tom Christie

unread,
Jul 11, 2016, 5:31:44 AM7/11/16
to Django REST framework
> As an aside, since JSON Web Tokens seem to be taking off, is there a chance DRF will natively support them in the future

Yes, I think that's reasonably likely, tho no firm decisions yet.

It's also possible that we could pull it under the banner of being an officially supported package, but without pulling it into the main repository (ie keeping it separately installable)
Reply all
Reply to author
Forward
0 new messages