PHPackages                             heimo/think-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. heimo/think-jwt

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

heimo/think-jwt
===============

jwt for thinkphp6

v1.0.0(5y ago)4341MITPHPPHP &gt;=5.6

Since Aug 18Pushed 5y agoCompare

[ Source](https://github.com/Heimo-He/think-jwt)[ Packagist](https://packagist.org/packages/heimo/think-jwt)[ Docs](https://github.com/Heimo-He/think-jwt.git)[ RSS](/packages/heimo-think-jwt/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

think-jwt
=========

[](#think-jwt)

基于thinkphp6的JWT权限验证插件

### 支持特性

[](#支持特性)

- hash对称加密
- OpenSSL非对称加密
- header或body获取
- 无需设置refreshToken，设置时间token自动更新

### 安装

[](#安装)

```
composer require heimo/think-jwt
```

Example
-------

[](#example)

### 配置文件`config/jwt.php`，公私玥使用openssl生成

[](#配置文件configjwtphp公私玥使用openssl生成)

```
$ openssl
$ OpenSSL> genrsa -out rsa_private_key.pem 1024
$ OpenSSL> rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
```

### 应用中对路由使用注册jwt校验中间件

[](#应用中对路由使用注册jwt校验中间件)

```
Route::group('hello', function(){

    ...

    Route::rule('hello/:name','hello');

})->middleware(\heimo\auth\middleware\Jwt::class);
```

### 生成token

[](#生成token)

```
Auth::make()->generateToken();

Auth::make()->refreshToken();//手动刷新token
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2099d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22815251?v=4)[Emil Kalapov](/maintainers/Heimo)[@Heimo](https://github.com/Heimo)

---

Top Contributors

[![Heimo-He](https://avatars.githubusercontent.com/u/26212318?v=4)](https://github.com/Heimo-He "Heimo-He (6 commits)")

---

Tags

phpjwtthinkphpthinkphp6tp6

### Embed Badge

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

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

###  Alternatives

[griffinledingham/php-apple-signin

A simple library to decode and parse Apple Sign In client tokens.

2011.9M1](/packages/griffinledingham-php-apple-signin)[swoft/auth

Auth component for swoft

127.2k1](/packages/swoft-auth)

PHPackages © 2026

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