Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes. [Laravel/Passport]

I am using laravel/passport for api authentication Today My old access token isn't working and When i try to generate new access token then i got

Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes. {"exception":"[object] (ErrorException(code: 0): Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.

Anyone have any solution?

like image 871
Senthurkumaran Avatar asked Nov 25 '20 16:11

Senthurkumaran


2 Answers

lcobucci/jwt:3.4 has this problem, you can downgrade to 3.3, composer require lcobucci/jwt:3.3 can resolve it.

Or, In config\jwt.php file Change :

'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class,

to

'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class,
like image 107
sta Avatar answered Oct 16 '22 08:10

sta


As said before, lcobucci/jwt:3.4 is causing this issue, which can be solved by downgrading to 3.3.*. However, if you have declared something like this:

"lcobucci/jwt": "^3.3.1",

you need to remove the ^ because v3.4 would still be downloaded. Please keep in mind, using a newer version might be better because of bugfixes and other stuff, so make sure to update the respective logic to work with a newer version of the dependecy.

like image 8
Sauerbrei Avatar answered Oct 16 '22 09:10

Sauerbrei