尋找Auth0的便捷性來整理我的Angular 2客戶端和Laravel 5.3 API之間的JWT。我已經按照(和雙重檢查,我已經跟隨)Auth0的入門指南:未經授權的用戶從curl調用Auth0調用Laravel 5.3 API
https://auth0.com/docs/quickstart/backend/php-laravel
,但似乎無法得到它我的身份驗證。當我蜷縮如下:
curl --request GET --url http://localhost/api/test --header 'authorization: auth0_id_token'
我得到:
Unauthorized user curl: (6) Could not resolve host: auth0_id_token
在我\routes\api
,我有:
Route::get('/test', array('middleware' => 'auth0.jwt', function() {
return "Hello " . Auth0::jwtuser()->name;
}));
我使用這個生成id_token
:
https://auth0.com/docs/api/authentication#!#post--oauth-ro
和Auth0認爲用戶已經登錄。
的,我應該尋找,試圖調試這任何指針可以看到,當我去(https://manage.auth0.com/#/users)?
非常感謝JoãoAngelo。這正是問題所在,儘管我檢查過我所有的Laravel都是正確的,但我沒有發現我的Curl是錯誤的。如果它幫助其他人,工作命令是:curl --request GET --url localhost/api/test --header「Authorization:Bearer auth0_id_token」。再次感謝。 – theotherdy