Strawberry-graphql port of the graphene-django-jwt package
Reason this release was yanked:
Should have been a pre-release
Project description
Strawberry Django JWT
JSON Web Token authentication for Strawberry Django GraphQL
Disclaimer
This project is a forked version of Django GraphQL JWT that substitutes Graphene GraphQL backend for Strawberry
Installation
-
Install last stable version from Pypi:
pip install strawberry-django-jwt
-
Add
AuthenticationMiddleware
middleware to your MIDDLEWARE settings:MIDDLEWARE = [ ..., 'django.contrib.auth.middleware.AuthenticationMiddleware', ..., ]
-
Add
JSONWebTokenMiddleware
middleware to your STRAWBERRY schema definition:from strawberry_django_jwt.middleware import JSONWebTokenMiddleware from strawberry import Schema schema = Schema(...) schema.middleware.extend([ JSONWebTokenMiddleware(), ])
-
Add
JSONWebTokenBackend
backend to your AUTHENTICATION_BACKENDS:AUTHENTICATION_BACKENDS = [ 'strawberry_django_jwt.backends.JSONWebTokenBackend', 'django.contrib.auth.backends.ModelBackend', ]
-
Add django-graphql-jwt mutations to the root schema:
import strawberry import strawberry_django_jwt.mutations as jwt_mutations @strawberry.type class Mutation: token_auth = jwt_mutations.ObtainJSONWebToken.obtain verify_token = jwt_mutations.Verify.verify refresh_token = jwt_mutations.Refresh.refresh delete_token_cookie = jwt_mutations.DeleteJSONWebTokenCookie.delete_cookie schema = strawberry.Schema(mutation=Mutation, query=...)
Documentation
Work in Progress
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for strawberry-django-jwt-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6b0407ae765da1e972d44d62e97fe6c0be91c91fcb5584d6e1b80949a8fa71 |
|
MD5 | 0817df286725430f963c47cd08607a30 |
|
BLAKE2b-256 | 19a7fc62203541dc7bb179fedb349d20014d22bbd1190ca02eea1190becc1579 |
Close
Hashes for strawberry_django_jwt-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0bab20d20c8039e04ae7063934ace2811466e8b1d69be4f42b9770f32a6de22 |
|
MD5 | 4279259e623f1971d17add2715f2bd36 |
|
BLAKE2b-256 | 87a359b4adbaf4bebaa1103d8511497419f14362a6f115e624bd2685bb77b186 |