june/jwt
最新稳定版本:1.0.1
Composer 安装命令:
composer require june/jwt
包简介
JWT Singleton encapsulation
README 文档
README
介绍
JWT Singleton encapsulation
安装
composer require june/jwt
使用说明
- Get token
use June\JWT\Jwt;
use June\JWT\Config;
$signingKey = "JuneSwoole";
$config = new Config();
$config->setKey($signingKey);
$config->setClaim("iss", "june");
$config->setClaim("aud", "JuneSwoole");
$config->setClaim("exp", time() + 7200);
$config->setClaim("jti", (string) getSoleId());
$token = Jwt::getInstance()->token($config);
- Validate token
use June\JWT\JwtValidate;
use June\JWT\Config;
use June\JWT\JwtException;
try {
$config = new Config();
$signingKey = "JuneSwoole";
$config->setKey($signingKey);
$tokenClaim = JwtValidate::getInstance()->claims($config, $token);
} catch (JwtException $th) {
echo $th->getMessage();
}
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-14