Authorization with HTTP header not working
See original GitHub issueProblem:
I have a JWT token provided and verifyToken mutation is working properly with provided token BUT when I set the Authorization header as “JWT <token>” it raises error with message “You do not have permission to perform this action.” (I have used login_required decorator in a mutation. I also use Postman for quering.) (I can make query from browser when I am logged in to admin panel.)
setting.py:
MIDDLEWARE = [
...
"django.contrib.auth.middleware.AuthenticationMiddleware",
...
]
GRAPHENE = {
"SCHEMA": "home.schema.schema",
"MIDDLEWARE": [
"graphql_jwt.middleware.JSONWebTokenMiddleware",
],
}
AUTHENTICATION_BACKENDS = [
"graphql_jwt.backends.JSONWebTokenBackend",
"django.contrib.auth.backends.ModelBackend",
]
GRAPHQL_JWT = {
"JWT_PAYLOAD_HANDLER": 'account.utils.jwt_payload',
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top Results From Across the Web
HTTP Authorization header not working - Stack Overflow
HTTP Authorization header not working · I think, EnableCors in the api part need to check @roopteja. – Saravanakumar Natarajan · 1 ·...
Read more >Authorization - HTTP - MDN Web Docs - Mozilla
The HTTP Authorization request header can be used to provide credentials that authenticate a user agent with a server, allowing access to a ......
Read more >API Authorization: header not working · Issue #4243 - GitHub
Using the /api/swagger web UI, hit the 'Authorize' button and put your token into the AuthorizationHeaderToken value field. · Create a new issue ......
Read more >Question: Https client authorization header not set when using ...
Hi, Hi, Can't get the http client to interpret replacement variables for http headers. I use dynamic document properties to set replacement variables....
Read more >Auth token is not passing through header - the Tyk community
Maybe you can try to change the Authorization header name for one of the Auth types in tyk. I faced a similar issue...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s because of middleware do this:
setting.py
:urls.py
file:Didn’t work for me. Can someone help please?