Questions tagged [django-graphql-jwt]

This tag is for the implementation of django-graphql-jwt which is a

JSON Web Token authentication for Graphene-Django

28 questions
1
vote
1 answer

How to authenticate with django-grahql-jwt in a graphene-django Using GraphQLTestCase?

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…
Udemezue John
  • 128
  • 2
  • 12
1
vote
1 answer

GraphQL: [Errno 111] Connection refused

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…
Mostafa Ghadimi
  • 5,883
  • 8
  • 64
  • 102
1
vote
1 answer

RecursionError at /graphql. maximum recursion depth exceeded

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…
Mostafa Ghadimi
  • 5,883
  • 8
  • 64
  • 102
1
vote
1 answer

JWT validation in class based view django

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…
Petr Schukin
  • 170
  • 2
  • 12
1
vote
1 answer

How to test GraphQLError exception in graphene_django or graphql_jwt?

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…
1
vote
1 answer

DJANGO-GRAPHQL-JWT: How do we know how old is the refresh token after it has been issued?

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…
Shift 'n Tab
  • 8,808
  • 12
  • 73
  • 117
0
votes
0 answers

Authenticating queries in Django Graphene custom nodes with filters and connections?

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…
Bhaskar
  • 302
  • 2
  • 13
0
votes
0 answers

Unable to authenticate using cookie-based authentication in Django React

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…
0
votes
1 answer

Single token refresh vs Long running refresh tokens (Django GraphQL JWT)

I used both "Single token refresh" mode and "Long running refresh tokens" mode. "Single token refresh" mode: GRAPHQL_JWT = { "JWT_VERIFY_EXPIRATION": True, "JWT_EXPIRATION_DELTA": timedelta(minutes=5), "JWT_REFRESH_EXPIRATION_DELTA":…
0
votes
1 answer

Django GraphQL API with JWT authentication implementation still allows for unauthenticated requests from Postman get data. How do I fix this?

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…
0
votes
1 answer

Django GraphQL Mutation Updated, but no change in Database

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 =…
Andy Huang
  • 347
  • 2
  • 13
0
votes
1 answer

customize the get_payload function in django-graphql-jwt

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…
Aymane Max
  • 182
  • 11
0
votes
1 answer

Invalid response of GraphQL request via CORS and valid response via GraphiQL processing authentication with JWT

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.…
1
2