Passport Package returning “Unauthenticated” Error

2019-08-19 17:58发布

I am using Passport Package for the API requests. It was working fine with my old server and the request was authenticated but since I have moved my application to a newer server I am receiving Invalid Token Error. Been searching on the google from last 2 days but didn't find any solution.

The API successfully returning me the token but when I am using that token to authenticate the user it gives me "Unauthenticated" error and redirects me to Home.

Everything is working fine on my old server. Not sure what to change to get this working. Any help will be appreciated.

2条回答
ら.Afraid
2楼-- · 2019-08-19 18:12

Try to create new client credentials

php artisan passport:client --password

Or regenerate the keys

php artisan passport:keys --force
查看更多
淡お忘
3楼-- · 2019-08-19 18:14

Check webServer probably it does not forward auth headers to php backend RewriteEngine On RewriteCond %{HTTP:Authorization} .+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

查看更多
登录 后发表回答