I am trying to test my Laravel php application with middleware using Postman. The application is using Tymon JWT Auth and according to the docs I should set the Authorization header:
Authorization: Bearer {yourtokenhere}
So, I've added the Authorization header to Postman like so:
But the response I get from my app is that token is not provided.
It's strange because:
- If I attach the same token to url in Postman, the token is visible to the app (status 200 OK and no error saying token_not_provided).
- If I test the app in PHPUnit instead of Postman and provide the token either in header or in url, it is also OK.
- Debugging the raw Postman request in Fiddler shows that it actually has the Authorization header, as visible below:
I also tried deleting the other two headers from Postman but it didn't improve anything. So it seems that all is set up fine, but it's not working, why?