I followed the steps in this video: What's New in Laravel 5.3: Laravel Passport
In this video it guides you to the step where you authenticate through Postman App by using it's autogenerated Token.
I followed the steps very carefully but i get unauthenticated in Postman App.
My environment is:
OS: CentOS 7
Apache/2.4.6 (CentOS)
PHP 7.0.17
Composer version 1.3.2
Node v6.9.5
NPM 3.10.10
In Postman App, I input 2 keys in the Headers section:
In the end of the process i get:
{
"error": "Unauthenticated."
}
Can the steps in the video be used in Laravel 5.4 for the oAuth Token or is it missing some steps?
Thank You in advance!
Did you make sure to put a _space_ between 'Bearer' and the actual token?
Bearer yourrandomtoken
Also what token are you using? You should be using the one you receive after login, not the one id of secret generated for your client.
Thank you for pointing out the space between 'Bearer' and 'token' @jorenvh1 .
Another thing that was missing is:
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
This has to be placed in the conf file if were using Apache Server for it to recognize the headers.
with nginx, how to solve it ?
Make sure your local public/.htaccess and servers public/.htaccess files had same content. This may help.
Most helpful comment
with nginx, how to solve it ?