lundi 31 décembre 2018

Laravel Passport not authenticating with JWT cookie (self consuming API)

I've gone through the entire page of documentation and as far as I can tell I have everything set up exactly as the documentation states. However, when I attempt to make a GET request to /api/users it always returns a 401 Unauthorized.

If I inspect the request, I see that the laravel_token is indeed being passed along with the request, as well as CSRF.

At this point, I'm not really sure why it's always failing to authenticate, but it's pretty frustrating and I'm sure it's something minor that I'm overlooking somehow.

I'm using Laravel 5.7.5.

Configuration steps done:

  • Ran php artisan passport:install
  • Added trait to User model
  • Added Passport::routes() to AuthServiceProvider::boot()
  • Changed API driver to passport in config/auth.php
  • Added CreateFreshApiToken::class to web middleware


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire