rw/jwt

This package is abandoned and no longer maintained. The author suggests using the revenuewire/jwt package instead.

handle JWT token and validation

v2.2.1 2018-02-20 19:51 UTC

This package is auto-updated.

Last update: 2022-02-01 13:06:34 UTC


README

Build Status Coverage Status Latest Stable Version

JWT Token

require_once ("vendor/autoload.php");

$jwt = new \RW\JWT\Token();
$jwt->setIssuer('carambola')
    ->setAudience('jackfruit')
    ->setSecret("super-01-secret")
    ->setPayload(array("hello" => "world"))
    ->setExpiry(5);
$token = $jwt->getToken();
echo $token . "\n";

JWT Validation

$validator = \RW\JWT\Token::init($token);
$payload = $validator->setSecret("super-01-secret")
                ->validate()
                ->getPayload();
print_r($payload);