Lexikjwtauthenticationbundle: php8 compatibility

Created on 22 Nov 2020  路  8Comments  路  Source: lexik/LexikJWTAuthenticationBundle

After updating to php 8 I got that strange error in tests:
InvalidArgumentException: It was not possible to parse your key, reason: /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Signer/OpenSSL.php:90 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Signer/OpenSSL.php:47 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Signer/OpenSSL.php:21 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Signer/BaseSigner.php:36 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Builder.php:470 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lcobucci/jwt/src/Builder.php:450 /builds/riverwaysoft/rebelbee/phonedo_project/phonedo/vendor/lexik/jwt-authentication-bundle/Services/JWSProvider/LcobucciJWSProvider.php:99
Reason of error is empty.

Problem pointed here:
小薪懈屑芯泻 褝泻褉邪薪邪 2020-11-23 胁 00 05 05

Most helpful comment

Hey,

I'm working on the PHP 8 support. I'll keep you informed.

All 8 comments

Hey,

I'm working on the PHP 8 support. I'll keep you informed.

@chalasr @mitalcoi
Issue is caused by resource to object migration, see https://php.watch/versions/8.0/OpenSSL-resource
It has been fixed in lcobucci/jwt in version 4.0.0 (https://github.com/lcobucci/jwt/pull/431)
So maybe just update composer.json lcobucci/jwt to v4?

Just updated to 2.10.0 - it did't help

lcobucci/jwt v 4.0.0 cannot be installed locally, it is also locked: (lexik/jwt-authentication-bundle v2.10.0 requires lcobucci/jwt ^3.2 -> found lcobucci/jwt[3.2.0, ..., 3.4.1] but it conflicts with your root composer.json require (^4.0.0))

@mitalcoi
Yp, because in this repo in composer.json it still states "lcobucci/jwt": "^3.2"

@chalasr can you update composer.json with actual version lcobucci/jwt?

We need to make the bundle compatible with lcobucci/jwt v3.4 first.
Should be resolved quickly, I'm going to look at it this weekend.

Only cow I've found the same trouble with OpenSSLAsymmetricKey class instead of resource. I wish I could had see this issue early instead of "wasting" my time :joy:

Can't wait to see a fix! :) :muscle:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Walkoss picture Walkoss  路  5Comments

hiromik picture hiromik  路  3Comments

garak picture garak  路  5Comments

reducio picture reducio  路  4Comments

christophe-mailfert picture christophe-mailfert  路  5Comments