Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify()

I'm working on a project to learn laravel, I saw a couple of tutorials to use jwt auth in this. It was working good but now is show an error not always but I don't know why. this is it:

Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() must be an instance of Lcobucci\JWT\Signer\Key, null given, called in C:\xampp\htdocs\inmobiliaria\vendor\lcobucci\jwt\src\Signer\BaseSigner.php on line 42

Sometimes it works but not another. so I don't know what can I do. I tried with

  1. php artisan cache:clear
  2. php artisan config:clear
  3. php artisan jwt:secret

but the problem still there, sometimes i get good answer from server(200) but the most part of then al bad (500).

Screenshots

enter image description here

enter image description here

like image 930
Esteban Avatar asked Nov 19 '18 16:11

Esteban


2 Answers

Here's complete snippet

php artisan key:generate
php artisan jwt:secret
php artisan cache:clear
php artisan config:clear

Before run above commands make sure there is install jwt package, than check its config file name jwt.php in config folder.

like image 160
Muhammad Sulman Avatar answered Nov 19 '22 17:11

Muhammad Sulman


In fact it's the right thing to solve it:

php artisan key:generate
php artisan jwt:secret
like image 29
Tiago Gouvêa Avatar answered Nov 19 '22 17:11

Tiago Gouvêa