Skip to content

InvalidCredentialsException when getting access token via POST #49

Description

@ateeqdev

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":"esben@esben.dk",
    "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".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions