ekok / php-jwt
PHP JWT
v0.1.0
2022-03-28 06:17 UTC
Requires
- php: >=8.0
Requires (Dev)
- codeception/codeception: ~4.1
- codeception/module-asserts: ^1.0.0
- codeception/module-phpbrowser: ^1.0.0
This package is auto-updated.
Last update: 2024-11-28 12:17:29 UTC
README
Based on firebase/php-jwt
<?php $options = array( 'key' => 'mySecr3TKey~', // options defaults value // 'id' => null, // or jti // 'leeway' => 0, // 'keyId' => null, // 'publicKeys' => array(), // 'header' => array(), // 'algorithm' => null, // or alg // 'issuer' => null, // or iss // 'expires' => null, // or exp // 'subject' => null, // or sub // 'audience' => null, // or aud // 'notBefore' => null, // or nbf // 'issuedAt' => null, // or iat ); $jwt = new Ekok\JWT\Manager($options); $payload = array( 'foo' => 'bar', ); $token = $jwt->encode($payload); $decoded = $jwt->decode($token); // $decoded === $payload