I have 2 servers , an laravel API and an Auth server with passport. The authentication server generates the access token normally , i'm using client credentials.
When i try to protect my routes in API using the middleware auth:api
or client
, where it is defined on Kernel.php
it returns me 401 Unauthenticated
the API dont read the token correctly.
My route in the API
Route::middleware('client')->group(function () {
Route::resource('invoice' , 'InvoiceController')->middleware('scopes:x');
});
It returns 401, and the same route in Auth server works perfectly.