The routing configured by laravel5.3routeapi. php always prompts "Unauthenticated". I added _ tokenxxxx and didn't use the routing configured by laravel 5.3 route/api. php. the prompt "Unauthenticated" is displayed, and I added _ token = xxxx.
Reply content:
Laravel 5.3 route/api. php always prompts "Unauthenticated" for the route configuration. I have added _ token = xxxx and it is useless.
1. check whetherpassport
composer require laravel/passport
For details about the configuration, see the API authorization document.
2. modify
PassportServiceProvider.php
ModifyPassportServiceProvider.php
// Set the expiration time of 100year !!!!!!! Over 2038 $ server-> enableGrantType (new PersonalAccessGrant, new DateInterval ('p100y'); // change to 1 year $ server-> enableGrantType (new PersonalAccessGrant, new DateInterval ('p1y '));
Cause:
4 bytes, that is, the maximum value of a 32-bit bucket is 2147483647. when the last thrilling second of 2147483647 is completed in one second, it is converted to a negative number, that is, the time is invalid. The accurate time of that moment is, Monday, January 18, 2038. after that, all C language programs that use this "standard time Library" will encounter time computing troubles.
This is the 2038 issue.