close

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

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

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

Today I get the following error Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() in php.

How To Solve Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() Error ?

  1. How To Solve Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() Error ?

    To Solve Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() Error In fact it's the right thing to solve it:
    php artisan key:generate php artisan jwt:secret

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

    To Solve Jwt Authentication error Argument 3 passed to Lcobucci\JWT\Signer\Hmac::doVerify() Error In fact it's the right thing to solve it:
    php artisan key:generate php artisan jwt:secret

Solution 1


This error can occur when

  • JWT_SECRET is missing on the .env
  • JWT_SECRET is commented in the .env
  • The value of JWT_SECRET is wrong.

In my case, running php artisan jwt:secret it was appending the key on the current JWT_SECRET. So checking my .env file, the value of JWT_SECRET was very long and wrong (it should be 64 chars long).

To solve it:

  1. Open the .env and remove the JWT_SECRET value (note that you have to remove it and not comment it).
  2. Run php artisan jwt:secret

Solution 2

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

php artisan key:generate
php artisan jwt:secret

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment