寻找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