Problem Description:
Routing can be a normal visit, but the authentication fails,
Since the request needs to be performed, curl -X GET "http://api.jr.com/v1/salary/list" -H "accept: application / json" -H "Authorization: Bearer 123456"
That is, we need to perform the curl command fails,
Code | Details |
401
Undocumented
|
Error: Unauthorized
Response body{ "name": "Unauthorized", "message": "You are requesting with an invalid credential.", "code": 0, "status": 401, "type": "yii\\web\\UnauthorizedHttpException" } |
problem analysis
solution
You need to open the cgi
Supplement appache configuration
CGIPassAuth on
To my directory configuration,
Because Apache is hidden authorization header