This repository has been archived by the owner on Jan 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
API Tokens
Byron Ruth edited this page May 2, 2013
·
2 revisions
Serrano supports token-based access using a temporary session-based API token. Users must send an initial POST request to Serrano's root endpoint with their credentials. Upon successful authentication, a temporary API token will be created and returned in the response. This token can be supplied with subsequent requests for the remainder of the session (rather than constantly supplying credentials).
To install, add serrano.backends.TokenBackend
to the AUTHENTICATION_BACKENDS
setting:
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'serrano.backends.TokenBackend',
...
)
Integer of seconds until a token expires. Note, the token timeout is fixed and does not reset upon each request. Default is the same as the SESSION_COOKIE_AGE
Django setting
Docs
Resource Docs
Development