Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how long is token valid? Django REST Framework

I am using Django Rest Framework token-authentication mechanism.

http://www.django-rest-framework.org/api-guide/authentication#tokenauthentication

It creates database table with field created with the value equal to the timestamp, when te token was created. E.g: 2014-04-07 07:42:50.395626

Anyone knows how long is this token valid? I can not find this info on mentioned website.

I am also wondering, that this token is still valid, even when the user changes password. Shouldn't it generate a new one, or at least make the old on no more valid?

like image 367
andilabs Avatar asked Apr 08 '14 16:04

andilabs


People also ask

What is token in Django REST framework?

Token authentication refers to exchanging username and password for a token that will be used in all subsequent requests so to identify the user on the server side. This article revolves about implementing token authentication using Django REST Framework to make an API.

What is a token in REST?

Users of the REST API can authenticate by providing a user ID and password to the REST API login resource with the HTTP POST method. An LTPA token is generated that enables the user to authenticate future requests.


1 Answers

Answer to this question can be found HERE:

SHORTLY: this token is valid infinitely long.

If you would like to have token, which expires after certain time, please refere to examples shown in mentioned question.

like image 132
andilabs Avatar answered Oct 11 '22 20:10

andilabs