vakata / jwt
JWT token handling
Installs: 4 088
Dependents: 1
Suggesters: 1
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0.0
README
JWT token handling.
Install
Via Composer
$ composer require vakata/jwt
Usage
$token = new \vakata\jwt\JWT(); $token ->setClaim("key", "value") ->setExpiration("+30 days") ->setIssuer("System") ->sign("secretKey"); $stringified = (string)$token; $parsed = \vakata\jwt\JWT::fromString($stringified); var_dump($parsed->isValid()); // true var_dump($parsed->isSigned()); // true var_dump($parsed->verifyHash("secretKey")); // true var_dump($parsed->getClaim("key")); // "value"
Read more in the API docs
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.