I use Django and Graphene in my project. I wrote tests with GraphQLTestCase. When i try to authenticate users using JWT, i usually get errors.
Here is my code:
from django.test import TestCase
import json
from graphene_django.utils.testing import…
Description
I am trying to build an API for a transportation system which has different kind of users (Driver, Customer, SystemAdmin and Authorizer). For this purpose I created an AbstractUser and use inheritance relationship for the all of the…
Problem Definition:
I have read the article about adding JWT authentication my project using graphene-jwt package from this official link. According to what is said in the tutorial, some changes should be applied to the project settings.py…
I've implemented jwt authentication in django using Django-graphql-jwt library, now I want to allow get/post on my endpoint (/graphql) only for requests with JWT token. There are examples in django-graphql-jwt documentation like @login_required, but…
I am implementing user types and authentication in django using graphene_django and graphql_jwt. Here are my two files: the code and the corresponding tests located in a folder named 'users' which is app-level folder(but not a django…
Overview
Based on the concept found on Settings section of Long Running Refresh Token.
It means that you need to refresh [access token] every 5 mins and you need to replace your refresh token in 7 days after it has been issued.
This will enable…
I'm working on a Django project using Graphene for GraphQL API implementation. I have a custom node called PoemNode which extends DjangoObjectType. I want to authenticate queries made to this node and also include filtering and pagination…
I am trying to run a Django server and React app with cookie-based authentication. The authentication is being done using django-graphql-jwt and Apollo Client. The authentication process works correctly and I am receiving a JWT token, but the…
I've built a Django API that uses django-graphql-auth and django-graphql-jwt packages to implement authentication. I followed the package's documentation and got everything to work and everything is working from my Angular UI. The only issue is that…
I created an update mutation as follows, with django==3.1.4 and graphene==2.1.8 :
# models.py
class CustomUser(AbstractUser):
# email = models.EmailField()
firebase_id = models.CharField(max_length=50, null=True)
nickname =…
please, how can I customise the get_payload function in django-graphql-jwt?
def get_payload(token, context=None):
try:
payload = jwt_settings.JWT_DECODE_HANDLER(token, context)
except jwt.ExpiredSignature:
raise…
The problem is that I always receive a 400 response code without any payload.
Even something goes wrong graphql passes with code 200 and payload with error block. That fact, that GraphiQl works fine, tells me that settings and schema are correct.…