I am using:
Postman/Insomnia for REST checking
Laravel 5.6 with Laravel Passport
Vagrant (Apache 2, PHP 7.2)
Made all checklist described on Laravel Docs for Laravel Passport and after certain steps I receive HTTP 401 for my valid OAuth access token.
Requested by /oauth/token/ the new access token with client_id and client_secret.
Used received access token to authorize my simple Laravel REST test controller with included Oauth api middleware.
The end is one: 401 unauthorized :(
So, here is some of my configurations:
Apache

api route

Kernel.php

PassportServiceProvider.php

AuthServiceProvider.php

Can you post the request you are issuing to obtain your token, im sure that is where your issue is. You can t use a token that is issued incorrectly.
@andrewmclagan I am getting this issue with Laravel 5.6 now as well. I have had it since Laravel 5.3 where I can get the token just fine, but trying to use the token to access a link that uses auth:api always returns 401 unathenticated. I always resort to using another package as I have tried everything suggested online and nothing ever works for me to solve the problem.
As I stated above, we need to see the request you are making to obtain a token.
This is not a forum for “how to use passport” it’s for issue tracking. Logging an issue on an issue tracker you do the following:
Questions like you posed “why do I get 401, here are Some code screenshots” is basically asking us to do your work for you. We are not your co-workers. Stackoverflow is used for these userland issues.
But since you asked:
Clear your cache, clear your config, clear the database, reinstall.
Okay, the problem was solved.
Do not now what exactly that was but when I set up laravel passport vue components to manage clietns and used in Insomnia authorize url (/oauth/authorize) all is okay.
Earlier I didn't used authorize route, just Client Creditinails as I see. Also I edited some config files in Kernel to use to use client_credentials.
I forgot to include the auth:api middleware on the routes that need api-authentication, causing this issue

I am facing this error while login with social media
Most helpful comment
As I stated above, we need to see the request you are making to obtain a token.
This is not a forum for “how to use passport” it’s for issue tracking. Logging an issue on an issue tracker you do the following:
Questions like you posed “why do I get 401, here are Some code screenshots” is basically asking us to do your work for you. We are not your co-workers. Stackoverflow is used for these userland issues.
But since you asked:
Clear your cache, clear your config, clear the database, reinstall.