0
votes

I am new in Laravel Passport and I am able to get the the tokens from Laravel like below with Postman.

enter image description here

With this token, I tried to access my api route user-details

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

Here I am getting

{
"error": "Unauthenticated."
}

Screenshot:

enter image description here

What is the issue actually ?

1
Already checked this question, No hope.!!!!Jishad

1 Answers

0
votes

Since you didn't mention this step, I am guessing you might have missed this step.

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

Read the documentation fully.

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