当我尝试验证令牌时,JWT-Auth响应token_not_provided

时间:2017-12-29 11:37:09

标签: php angular laravel-5 jwt-auth

据我所知,Laravel后端的一切都很合适,因为它在Postman中运行良好,但是当我尝试从前端验证令牌时(Angular 4)JWT-Auth抛出错误{"error":"token_not_provided"} 这就是我的请求标题的样子。

POST /api/user HTTP/1.1
Accept:          application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-IN,en-GB;q=0.9,en-US;q=0.8,en;q=0.7
Connection:      keep-alive
Content-Length:  439
Content-Type:    application/json
Host:            localhost:8000
Origin:          http://localhost:4200
Referer:         http://localhost:4200/
User-Agent:      Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36(KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36

{
    "header": {
        "Content-type": "application/json",
        "Authorization": "Bearer eyJ0eXAiOiJKV .... vBMbwBypj6uv4Ks",
        "Accept": "application/json;odata=verbose"
    }
}

0 个答案:

没有答案
相关问题