title: Laravel Passport API call always return Unauthenticated
body: <p>So I have setup my API with Passport and tried to make GET request for almost a week now but still getting the response bellow :</p>
  
  <pre><code>{
  "message": "Unauthenticated."
  }
  </code></pre>
  
  <p>Below are my configuration :</p>
  
  <h1>Auth.php</h1>
  
  <pre><code>'defaults' =&gt; [
      'guard' =&gt; 'web',
      'passwords' =&gt; 'users',
  ],
  
  'guards' =&gt; [
      'web' =&gt; [
          'driver' =&gt; 'token',
          'provider' =&gt; 'users',
      ],
  
      'api' =&gt; [
          'driver' =&gt; 'passport',
          'provider' =&gt; 'users',
          //'hash' =&gt; true,
      ],
  ],
  </code></pre>
  
  <h1>AuthServiceProvider.php</h1>
  
  <pre><code>public function boot()
  {
      $this-&gt;registerPolicies();
  
      //
      Passport::routes();
      Passport::tokensExpireIn(Carbon::now()-&gt;addDays(7));
  
     Passport::refreshTokensExpireIn(Carbon::now()-&gt;addDays(14));
  
  
  
  }
  </code></pre>
  
  <h1>RouteServiceProvider</h1>
  
  <pre><code> protected function mapApiRoutes()
  {
      Route::prefix('api')
           -&gt;middleware('auth:api')
           -&gt;namespace($this-&gt;namespace)
           -&gt;group(base_path('routes/api.php'));
  }
  </code></pre>
  
  <h1>Controller : Token request function using user credentials as per <a href="https://laravel.com/docs/5.8/passport" rel="nofollow noreferrer">laravel doc</a></h1>
  
  <pre><code>public function callback(Request $request)
  {
       $http = new Client();
      $token_url=url('oauth/token');
  
  $response = $http-&gt;post($token_url, [
      'form_params' =&gt; [
          'grant_type' =&gt; 'password',
          'client_id' =&gt; $this-&gt;client_id,
          'client_secret' =&gt; $this-&gt;client_secret,
          'username'=&gt;'my-username',
          'password'=&gt;'my-password',
          'scope' =&gt;'*',
      ],
  ]);
  
  return json_decode((string) $response-&gt;getBody(), true);
  }
  </code></pre>
  
  <p>Which returns an access_token that I use in my request in my request .  I tried all the solution listed below and none of them worked : </p>
  
  <h1><a href="https://github.com/laravel/passport/issues/452" rel="nofollow noreferrer">.htaccess</a></h1>
  
  <pre><code># Handle Authorization Header
   RewriteCond %{HTTP:Authorization} .
   RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  </code></pre>
  
  <h1><a href="https://laracasts.com/discuss/channels/laravel/laravel-53-passport-api-unauthenticated-in-postman-using-personal-access-tokens" rel="nofollow noreferrer">Passport.php line 167</a></h1>
  
  <pre><code> public static function tokensExpireIn(DateTimeInterface $date = null)
  {
      if (is_null($date)) {
          return static::$tokensExpireAt
                          ? Carbon::now()-&gt;diff(static::$tokensExpireAt)
                          : new DateInterval('P1Y');
      }
  
      static::$tokensExpireAt = $date;
  
      return new static;
  }
  </code></pre>
  
  <p>Please help , I'm desperate now :) </p>