2017-09-21 58 views
0

我是Laravel Passport中的新成员,并且能够从邮局中获取像Laravel一样的令牌。Laravel 5.3 Passport api路由正在返回Unauthenticated error

enter image description here

有了这个道理,我试图访问我的API路线用户细节

Route::group(['middleware'=>'auth:api'],function(){ 
    Route::get('user-details','[email protected]'); 
}); 

在这里我得到

{ 
"error": "Unauthenticated." 
} 

截图:

enter image description here

实际情况是什么?

+0

您可以检查它在这里https://stackoverflow.com/questions/39228194/passport-unauthenticated-laravel-5-3 – Abhishek

+0

已经选中了这个问题,没有希望。!!!! – Jishad

回答

0

既然你没有提到这一步,我猜你可能错过了这一步。

'api' => [ 
    'driver' => 'passport', 
    'provider' => 'users', 
    ], 

完全阅读文档。

https://laravel.com/docs/5.5/passport

+0

已经配置相同。 – Jishad

+0

https://laravel.com/docs/5.5/passport#client-credentials-grant-tokens。嘿,你正在使用客户端凭证授权令牌,它不同于密码授权等。 – Bivin