mostafafathi/user-auth
最新稳定版本:v1.1.13
Composer 安装命令:
composer require mostafafathi/user-auth
包简介
Laravel package for user type management with SSO and OTP authentication
README 文档
README
A comprehensive Laravel package for user type management with SSO and OTP authentication support.
Features
- Multiple user types with permissions
- SSO authentication (SAML, OpenID Connect)
- OTP-based authentication as fallback
- Development-friendly with test email support
- Flexible configuration
Requirements
- PHP 8.2 or higher
- Laravel 11.x or 12.x
Installation
You can install the package via Composer:
composer require mostafafathi/user-auth
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="MostafaFathi\\UserAuth\\UserAuthServiceProvider" --tag=user-auth-config
Publish and run migrations:
php artisan vendor:publish --provider="MostafaFathi\\UserAuth\\UserAuthServiceProvider" --tag=user-auth-migrations
php artisan migrate
Seed user types:
php artisan db:seed --class=UserTypeSeeder
Usage
Environment Variables
Add these to your .env file:
USER_AUTH_METHOD=sso SSO_ENABLED=true OTP_ENABLED=true TEST_EMAIL=test@example.com
To Overwrite Routes
// SSO Routes Route::get('/auth/sso/redirect', [SsoAuthController::class, 'redirectToSso'])->name('sso.redirect'); Route::get('/auth/sso/callback', [SsoAuthController::class, 'ssoCallback'])->name('sso.callback'); // OTP Routes Route::get('/auth/verify', [SsoAuthController::class, 'otpVerifyPage'])->name('otpVerifyPage'); Route::post('/auth/otp/request', [SsoAuthController::class, 'requestOtp'])->name('otp.request'); Route::post('/auth/otp/verify', [SsoAuthController::class, 'verifyOtp'])->name('otp.verify');
SSO Configuration
Configure your SSO providers in the "config/user-auth.php" file.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-07