The rewritten title is: keyOrKeyArray must be an instance of Firebase\JWT\Key key or an array of Firebase\JWT\Key key in php ci4
P粉680000555
P粉680000555 2023-11-07 16:57:25
0
1
441

{ "title": "UnexpectedValueException", "type": "UnexpectedValueException", "code": 500, "message": "$keyOrKeyArray must be an instance of a FirebaseJWTKey key or an array of FirebaseJWTKey keys", "File": "E:varwwwhtmlprojectspansadminvendorfirebasephp-jwtsrcJWT.php", "OK": 416,

P粉680000555
P粉680000555

reply all (1)
P粉914731066

You can use the following sample code -

 'Test_UID', 'name' => 'Sankhnad Mishra', 'iat' => $issuedAt, 'exp' => $expirationTime ); $key = 'A_JWT_SECRET'; // Any string $alg = 'HS256'; // This is alg $token = JWT::encode($payload, $key, $alg); // Encode payload as a JWT Token $decodedToken = JWT::decode($token, new Key($key, 'HS256')); // Decode token to a payload $response = [ 'token' => $token, 'decodedToken' => $decodedToken ]; print_r($response); } }

If you run above then you will get the following response -

{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyaWQiOiJUZXN0X1VJRCIsIm5hbWUiOiJTYW5raG5hZCBNaXNocmEiLCJpYXQiOjE2NDU4MTU0OTUsImV4cCI6MTY0NTgxNTU1NX0.0CwT9quW8-teyob3ObRU5KQBfQYWamCSTVCrAk9UX-o", "decodedToken": { "userid": "Test_UID", "name": "Sankhnad Mishra", "iat": 1645815495, "exp": 1645815555 } }

So just select these codes from above as per your requirement.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!