A JSON Web Token authentication extension for the Django REST Framework.
Project description
drf_pyjwt
A JSON Web Token authentication extension for the Django REST Framework
Installation
Using pip
pip install drf_pyjwt
Using pipenv
pipenv install drf_pyjwt
Quick start
In your project’s settings.py
add these settings.
DRF_PYJWT_JWKS_URI = "https://api.sample/jwks.json"
DRF_PYJWT_ALGORITHMS = ["RS256"]
DRF_PYJWT_KWARGS = {"audience": "https://api.sample"}
In views.py
add PyJWTAuthentication
class to authentication classes.
@api_view(["get"])
@authentication_classes([PyJWTAuthentication])
@permission_classes([])
def example(request: Request) -> Response:
return Response({"some": "response"})
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
drf_pyjwt-0.0.6.tar.gz
(12.0 kB
view hashes)
Built Distribution
Close
Hashes for drf_pyjwt-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7afedbe74d809847dc86b0675868c4777fb0f8783120f4b7c56aac1923d49d48 |
|
MD5 | 304a3f8e241882871ce6ba6bb637ab2a |
|
BLAKE2b-256 | d0a02d81e4cb6bb291f5afe3ec93fa1cdc82540ddc4c334a1282a706c0315be5 |