简体   繁体   中英

Laravel Passport get Unauthenticated response although I used a valid token

I'm using Laravel 5.7 with Passport installed, every thing goes OK on localhost: sign-up, sign-in and all other functionalities, don't know why when I uploaded the project to the server I always get Unauthenticated error message.

so far, I can login and issue the access token, but when try using this token to access other routes it fails and shows the previous message.

All tests have done on Postman.

Note: when I inspected the request header I couldn't see the authorization parameter appear in the header !!

*******images***********

login OK

test authenticated route failed

*******images***********

any help here,,,

thanks in advance.

If the passport keys, then your keys files for authenticating the tokens are not available on the server... In this case, you can migrate the keys under the storage dir (which might be a bad idea) or generate a new key using the artisan... I hope this helps...

php artisan passport:keys 

For new new keys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM