业务流程/oidc-auth

用于JWT令牌认证的包

v1.0.5 2024-09-27 09:27 UTC

This package is auto-updated.

Last update: 2024-09-27 09:32:29 UTC


README

JWT令牌认证服务

PHP 8.x Laravel 8.x Yii 2.x Latest Stable Version Release date Release Version Total Downloads Pull requests Software License Stars

通知信使通道到Laravel Framework v6.0及以上版本。

安装

安装此包的推荐方式是通过Composer

composer require businessprocess/oidc-auth

Laravel使用方法

使用中间件 'auth:oidc'

\Illuminate\Support\Facades\Route::middleware(['auth:oidc'])->group(fn() => {

})

配置设置

添加到认证配置文件中

//Guard
    [
        'driver' => 'oidc',
        'provider' => null, // if null return OidcUser model 
        'decoder' => null, // Jwt token decoder (JwtDecoder), if null use service decoder
    ]

配置模型

class User extends Authenticatable
{
    use \OidcAuth\HasJwtToken;
}

可用方法