simple jwt handling for django REST Framework
Project description
drf-jwt
JSON Web Token plugin for Django REST Framework
install:
pip install .
let jwt do the authentification:
add 'drf_jwt.authentication.JSONWebTokenAuthentication' in authentication classes:
'DEFAULT_AUTHENTICATION_CLASSES': [
'drf_jwt.authentication.JSONWebTokenAuthentication',
]
make endpoints to login, get the jwt:
from drf_jwt.controllers import Auth
urlpatterns = [
path('api/login', Auth.as_view()),
]
suport GET and POST
POST:
{ login, password }
login will be the username of the "authenticate" function
GET:
return a JWT token, given the fact that you are authenticate
so, one could do a Basic Authentication to the GET endpoints to receve a JWT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-rest-jwt-0.1.40.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for django_rest_jwt-0.1.40-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c884b8aacaa409c6bc79336074719efcc15a2c5a3799f8f2891b2f7e6912421 |
|
MD5 | 48c97f95eedca86741148453a63bfc5a |
|
BLAKE2b-256 | fccccc49fe902f4beed8c20c10d55d5756d46fc94ca669fae66e992dcae28094 |