PHPackages                             lsxiao/jwt-auth - 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. lsxiao/jwt-auth

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

lsxiao/jwt-auth
===============

JSON Web Token Authentication for Lumen

v1.0.5(9y ago)461275[2 issues](https://github.com/lsxiao/jwt-auth/issues)Apache-2.0PHPPHP ^5.6 || ^7.0

Since Sep 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lsxiao/jwt-auth)[ Packagist](https://packagist.org/packages/lsxiao/jwt-auth)[ RSS](/packages/lsxiao-jwt-auth/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (7)Versions (8)Used By (0)

注意!!!
=====

[](#注意)

由于该库的主要目的是JWT的实现原理的技术分享，而我目前忙于公司的Android项目，暂没有时间维护当前扩展包(对Laravel5.4的兼容性不好)，并且扩展包稳定性还有待验证，不推荐使用到正式环境。

所以我推荐大家使用  :)，如果你有JWT相关不懂的，可以提issue，大家一起探讨。

如果你想学习JWT的实现原理，我相信本项目应该会带给你一些帮助:),配合专栏食用更佳

jwt-auth [![PHP version](https://camo.githubusercontent.com/7e05fc31853dc99402cf239a0cc59fe0bce606fb0f12102ae2dcd244a6596717/68747470733a2f2f62616467652e667572792e696f2f70682f6c737869616f2532466a77742d617574682e737667)](https://badge.fury.io/ph/lsxiao%2Fjwt-auth)
=======================================================================================================================================================================================================================================================================

[](#jwt-auth-)

Laravel/Lumen JSON Web Token 认证扩展包

待完成
---

[](#待完成)

- 更加详细的单元测试
- 命令行生成HMAC RSA 秘钥

引入jwt-auth到项目中
--------------

[](#引入jwt-auth到项目中)

```
composer require "lsxiao/jwt-auth"
```

使用方法
----

[](#使用方法)

### 配置jwt-auth

[](#配置jwt-auth)

#### Laravel

[](#laravel)

```
php artisan vendor:publish
```

jwt.php配置文件会被拷贝到项目根目录的config文件夹中

#### Lumen

[](#lumen)

在项目的lumen项目的根目录创建config文件夹,将`jwt.php`配置文件复制到此处

```
