Skip to main content

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

PyPI Version Maintainability

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",
    "ALGORITHMS": ["RS256"],
    "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.5.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

drf_pyjwt-0.0.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file drf_pyjwt-0.0.5.tar.gz.

File metadata

  • Download URL: drf_pyjwt-0.0.5.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for drf_pyjwt-0.0.5.tar.gz
Algorithm Hash digest
SHA256 dd741220acfd1611de8df1ab6f0c3556f7cf33b5abfa579c285741ff1b3b2f6f
MD5 895457c0566e85f2f56caff92afb2850
BLAKE2b-256 8006d500af16c3d6d639470fc7a3e5f0803cec36691d61d20ac32219eacc376b

See more details on using hashes here.

File details

Details for the file drf_pyjwt-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: drf_pyjwt-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for drf_pyjwt-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1ffcb68361cc5b531ac4a18b4c0722204fac55e67a07554eaa010579b0d10096
MD5 ad24451fd1446f4d21f6c4e3a5ec8e8b
BLAKE2b-256 00704e902dba95235998db989e9f8c68a633df964678a410ba162c70bebae812

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page