'Django Rest Framework Postman Token Authentication
I am using Django Rest Framework Token authentication and if i do curl http://localhost:8000/api/v1/users/?format=json -H 'Authorization: Token 0a813fdcd3f8846d6fa376f2592bbc678b0b8e85'
everything works fine.
But when i try to achieve that with Postman chrome client it nothing happens. What am i doing wrong??
Solution 1:[1]
You are setting the header to Authorization: Token
when it really should just be Authorization
. The header is actually just Authorization
, but the value is Token [token_string]
, where [token_string]
is the authorization token that you have obtained.
Solution 2:[2]
In addition to the above answer, make sure to enable "Follow Authorization header" under setting (See below screenshot)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kevin Brown-Silva |
Solution 2 | Husam Alhwadi |