flavors / django-graphql-jwt

JSON Web Token (JWT) authentication for Graphene Django
https://django-graphql-jwt.domake.io
MIT License
820 stars 172 forks source link

Selective application of JWT expiration check for specific operations #316

Open havardox opened 1 year ago

havardox commented 1 year ago

Currently, in Django GraphQL JWT, when the JWT_VERIFY_EXPIRATION setting is set to True, JWT expiration is enforced globally for all GraphQL mutations and queries. Any time you want to query something and the token has expired, it just gives the "Signature has expired" error message. I would want to instead apply JWT expiration selectively to specific operations instead of applying it to my entire API. Is there any way to do that?

Edit: It seems to only apply when the jwt_cookie decorator is enabled in urls.py. It reads the HttpOnly cookie and sees that the token is expired and throws the "Signature has expired" message, even when the resolver itself doesn't require JWT authentication.