smactactic/selso 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

smactactic/selso

最新稳定版本:v1.0.1

Composer 安装命令:

composer require smactactic/selso

包简介

Handler authorize for client

README 文档

README

Latest Version License

smactactic/selso is a Laravel package that provides secure JWT (JSON Web Token) "Our" Single Sign On authentication for client applications, built on top of firebase/php-jwt. The package simplifies JWT token handling and integrates seamlessly with Laravel's middleware system.

Features

  • Easy JWT authentication setup for Laravel applications
  • Middleware protection for routes
  • Configurable client credentials and redirects
  • Built on the reliable firebase/php-jwt library

Installation

Install the package via Composer:

composer require smactactic/selso

Configuration

Environment Variables

Publish the configuration file:

php artisan vendor:publish --tag=selso-config

Update the default guard in config/auth.php:

'defaults' => [
    'guard' => env('AUTH_GUARD', 'selso'),
    'passwords' => env('AUTH_PASSWORD_BROKER', 'users'),
],

Add a new guard under the guards section:

'guards' => [
    // .....

    'selso' => [
        'driver' => 'session',
        'provider' => 'selso',
    ],
]

Register a new user provider in the providers section:

'providers' => [
    .....

    'selso' => [
        'driver' => 'selso',
    ],
],

Configure your environment variables in .env:

SSO_CLIENT_ID=
SSO_CLIENT_SECRET=
SSO_REDIRECT_URI=http://localhost:8001/auth/callback
SSO_SERVER_URL=http://localhost:8000

Post-Login Redirect

Set the default redirect path after successful authentication in config/selso.php:

'redirect_after_login' => '/dashboard',

Usage

Protect your routes using the included middleware:

Route::middleware('selso.auth')->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
    // Add other protected routes here
});

Security

If you discover any security related issues, please email the author directly instead of using the issue tracker.

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-29