kuma-guy/jwt-auth-module
Composer 安装命令:
composer require kuma-guy/jwt-auth-module
包简介
JWT authentication module for BEAR.Sunday
关键字:
README 文档
README
JSON Web Token Authentication for BEAR.Sunday
Installation
Composer install
$ composer require kuma-guy/jwt-auth-module
Module install
This package contains two modules for installing JSON Web Token Authentication.
Symmetric way
use Ray\Di\AbstractModule; use BEAR\JwtAuth\Auth\Auth; use BEAR\JwtAuth\SymmetricJwtAuthModule; class AppModule extends AbstractModule { protected function configure() { $this->install(new SymmetricJwtAuthModule('symmetric algorithm', 'token time-to-live', 'secret')); $this->bind(Auth::class)->toProvider(AuthProvider::class)->in(Scope::SINGLETON); } }
Asymmetric way
use Ray\Di\AbstractModule; use BEAR\JwtAuth\Auth\Auth; use BEAR\JwtAuth\AsymmetricJwtAuthModule; class AppModule extends AbstractModule { protected function configure() { $this->install(new AsymmetricJwtAuthModule('asymmetric algorithm', 'token time-to-live', 'private key', 'public key', 'pass phrase')); $this->bind(Auth::class)->toProvider(AuthProvider::class)->in(Scope::SINGLETON); } }
Authentication
your user is injected by auth provider, you need to add this line in your resource class
use AuthInject;
统计信息
- 总下载量: 261
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-31