Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidCredentialsException when getting access token via POST #49

Open
ateeqdev opened this issue Nov 28, 2021 · 0 comments
Open

InvalidCredentialsException when getting access token via POST #49

ateeqdev opened this issue Nov 28, 2021 · 0 comments

Comments

@ateeqdev
Copy link

Steps to Reproduce

  1. Install & configure Larapi
  2. 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\\InvalidCredentialsException is thrown in infrastructure/Auth/LoginProxy.php:85

Root Cause

  • $this->apiConsumer->post('/oauth/token', $data); throws an internal Server error in infrastructure/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/passport uses thephpleague/oauth2-server which uses lcobucci/jwt "3.3.3".
@ateeqdev ateeqdev changed the title Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated. InvalidCredentialsException when getting access token via POST Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant