-
The error: PHP Fatal error: Uncaught Error: Cannot instantiate interface Lcobucci\JWT\Signer\Key My program: require __DIR__ . '/vendor/autoload.php'; use Lcobucci\JWT\Signer\Rsa\Sha256; use Lcobucci\JWT\Signer\Key; use Lcobucci\JWT\Builder; $host = '*****'; $private_key = '*****'; $uid = '*****'; $time = time(); $signer = new Sha256(); $privateKey = new Key(base64_decode($private_key, true)); $token = (new Builder())->identifiedBy(bin2hex(random_bytes(12))) ->expiresAt($time + 1 * 86400) ->getToken($signer, $privateKey); |
Beta Was this translation helpful? Give feedback.
Answered by
lcobucci
Jan 13, 2023
Replies: 1 comment
-
@TAURO-AG the error is correct, from v4+ that code is invalid. Please follow the documentation to make sure you have the expected code - pay close attention to the upgrading guide if you're migrating from v3.x |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lcobucci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@TAURO-AG the error is correct, from v4+ that code is invalid.
Please follow the documentation to make sure you have the expected code - pay close attention to the upgrading guide if you're migrating from v3.x