Passport Package returning “Unauthenticated” Error

人走茶凉 提交于 2019-12-11 15:56:02

问题


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.


回答1:


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




回答2:


Try to create new client credentials

php artisan passport:client --password

Or regenerate the keys

php artisan passport:keys --force


来源:https://stackoverflow.com/questions/50674552/passport-package-returning-unauthenticated-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!