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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With