承接 june/jwt 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

june/jwt

最新稳定版本:1.0.1

Composer 安装命令:

composer require june/jwt

包简介

JWT Singleton encapsulation

README 文档

README

介绍

JWT Singleton encapsulation

安装

composer require june/jwt

使用说明

  1. 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);
  1. 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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-14