PHPackages                             qifen/jwt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. qifen/jwt

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

qifen/jwt
=========

1.5(4y ago)0891MITPHP

Since Feb 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xsxs89757/jwt-webman)[ Packagist](https://packagist.org/packages/qifen/jwt)[ RSS](/packages/qifen-jwt/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (1)

webman jwt 认证插件
===============

[](#webman-jwt-认证插件)

安装
--

[](#安装)

```
composer require qifen/jwt-webman
```

基本用法
----

[](#基本用法)

### 生成令牌

[](#生成令牌)

```
use Qifen\Jwt\JwtToken;

$user = [
    'id'  => 2022,
    'name'  => 'lei.wang',
    'email' => '317448423@qq.com'
];
$accessToken = JwtToken::init()->generateToken($user);
```

##### 输出（json格式）

[](#输出json格式)

```
{
    "token_type": "Bearer",
    "expires_in": 36000,
    "access_token": "eyJ0eXAiOiJAUR-Gqtnk9LUPO8IDrLK7tjCwQZ7CI...",
    "refresh_token": "eyJ0eXAiOiJIEGkKprvcccccQvsTJaOyNy8yweZc..."
}
```

##### 响应参数

[](#响应参数)

参数类型描述示例值token\_typestringToken 类型Bearerexpires\_inint凭证有效时间，单位：秒36000access\_tokenstring访问凭证XXXXXXXXXXXXXXXXXXXXrefresh\_tokenstring刷新凭证（访问凭证过期使用 ）XXXXXXXXXXXXXXXXXXX### 获取当前uid

[](#获取当前uid)

```
$uid = JwtToken::init()->getCurrentId();
```

### 获取其他自定义字段

[](#获取其他自定义字段)

```
$email = JwtToken::init()->getExtendVal('email');
```

### 刷新令牌

[](#刷新令牌)

```
$accessToken = JwtToken::init()->refreshToken();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

6

Last Release

1484d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e26d34228dd7885fd40c2f1e33cd967313c27cf5509b831984b6994e00fbba87?d=identicon)[xsxs89757](/maintainers/xsxs89757)

---

Top Contributors

[![xsxs89757](https://avatars.githubusercontent.com/u/32379836?v=4)](https://github.com/xsxs89757 "xsxs89757 (5 commits)")[![MustBeBlue](https://avatars.githubusercontent.com/u/163366625?v=4)](https://github.com/MustBeBlue "MustBeBlue (2 commits)")

### Embed Badge

![Health badge](/badges/qifen-jwt/health.svg)

```
[![Health](https://phpackages.com/badges/qifen-jwt/health.svg)](https://phpackages.com/packages/qifen-jwt)
```

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[wp-graphql/wp-graphql-jwt-authentication

JWT Authentication for WPGraphQL

361118.4k1](/packages/wp-graphql-wp-graphql-jwt-authentication)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
