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()
toAuthServiceProvider::boot()
- Changed API driver to passport in
config/auth.php
- Added
CreateFreshApiToken::class
to web middleware
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2QZ3Blk
via IFTTT
Aucun commentaire:
Enregistrer un commentaire