1

I am getting an access_token from third party successful login.Now i want to decode this token using tymon/jwt-auth and get the payload from that token. When i try to decode same token using JWT IO debugger, it successfully decodes the token and payload is as expected. But in laravel when i try to convert that using following code

$payload = JWTAuth::decode(new Tymon\JWTAuth\Token($token))

I am getting error something like this:

Token Signature could not be verified

Can anyone please help me with these? Thanks!

Mira Thakkar
  • 339
  • 1
  • 6
  • 19
  • have you registered these `'jwt.auth' => 'Tymon\JWTAuth\Middleware\GetUserFromToken', 'jwt.refresh' => 'Tymon\JWTAuth\Middleware\RefreshToken',` in your middleware in `app/Http/Kernel.php` – Hiren Gohel Jun 20 '18 at 07:48
  • Also, you need to generate key using: `php artisan jwt:secret` – Hiren Gohel Jun 20 '18 at 07:52

1 Answers1

1

Laravel 5.4 - Token Signature could not be verified

Try this: https://github.com/tymondesigns/jwt-auth/issues/1124

Mayur Sojitra
  • 690
  • 7
  • 19