Laravel5.3api route always prompts Unauthenticated

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.