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 details)
Built Distribution
File details
Details for the file drf_pyjwt-0.0.6.tar.gz
.
File metadata
- Download URL: drf_pyjwt-0.0.6.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d158132052283b1bb75446d4247aa23fbd2c757c5a1a12f45fb0ed0d71f62997 |
|
MD5 | a4eb6940676c93d14ab87aa984073abf |
|
BLAKE2b-256 | f34afee0a22480987f96ea27b7a6bf2f56b397332a9fbdc03c54ef0dd8790ffd |
File details
Details for the file drf_pyjwt-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: drf_pyjwt-0.0.6-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.25.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7afedbe74d809847dc86b0675868c4777fb0f8783120f4b7c56aac1923d49d48 |
|
MD5 | 304a3f8e241882871ce6ba6bb637ab2a |
|
BLAKE2b-256 | d0a02d81e4cb6bb291f5afe3ec93fa1cdc82540ddc4c334a1282a706c0315be5 |