larapi
larapi copied to clipboard
InvalidCredentialsException when getting access token via POST
Steps to Reproduce
- Install & configure Larapi
- Send a postman request to get the access_token
php artisan serve
curl -X POST http://localhost:8000/login -H 'Content-Type:application/json' -d '
{
"email":"[email protected]",
"password":"1234"
}'
Expected Result:
- The access_token should be returned as response
Actual Result:
-
Infrastructure\\Auth\\Exceptions\\InvalidCredentialsExceptionis thrown ininfrastructure/Auth/LoginProxy.php:85
Root Cause
-
$this->apiConsumer->post('/oauth/token', $data);throws an internal Server error ininfrastructure/Auth/LoginProxy.php -
Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.
Resolution
-
composer require lcobucci/jwt=3.3.3 -
laravel/passportusesthephpleague/oauth2-serverwhich useslcobucci/jwt "3.3.3".