PHPackages                             mostafafathi/user-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. mostafafathi/user-auth

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

mostafafathi/user-auth
======================

Laravel package for user type management with SSO and OTP authentication

v1.1.13(9mo ago)024MITPHPPHP ^8.2

Since Oct 7Pushed 8mo agoCompare

[ Source](https://github.com/MostafaFathi/user-auth)[ Packagist](https://packagist.org/packages/mostafafathi/user-auth)[ RSS](/packages/mostafafathi-user-auth/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (14)Used By (0)

Laravel User Auth Package
=========================

[](#laravel-user-auth-package)

A comprehensive Laravel package for user type management with SSO and OTP authentication support.

Features
--------

[](#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
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.x or 12.x

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require mostafafathi/user-auth
```

Configuration
-------------

[](#configuration)

### Publish the configuration file:

[](#publish-the-configuration-file)

```
php artisan vendor:publish --provider="MostafaFathi\\UserAuth\\UserAuthServiceProvider" --tag=user-auth-config
```

### Publish and run migrations:

[](#publish-and-run-migrations)

```
php artisan vendor:publish --provider="MostafaFathi\\UserAuth\\UserAuthServiceProvider" --tag=user-auth-migrations
php artisan migrate
```

### Seed user types:

[](#seed-user-types)

```
php artisan db:seed --class=UserTypeSeeder
```

Usage
-----

[](#usage)

Environment Variables
---------------------

[](#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
-------------------

[](#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
-----------------

[](#sso-configuration)

Configure your SSO providers in the "config/user-auth.php" file.

License
-------

[](#license)

The MIT License (MIT). Please see License File for more information.

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

13

Last Release

295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3037c442d321b3296ff563bc97b7a3508657d5abec315e4ca2412c5cab2b6c2?d=identicon)[mostafahilles](/maintainers/mostafahilles)

---

Top Contributors

[![MostafaFathi](https://avatars.githubusercontent.com/u/13615013?v=4)](https://github.com/MostafaFathi "MostafaFathi (26 commits)")

---

Tags

laravelotpAuthenticationSSOsamlOpenId

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mostafafathi-user-auth/health.svg)

```
[![Health](https://phpackages.com/badges/mostafafathi-user-auth/health.svg)](https://phpackages.com/packages/mostafafathi-user-auth)
```

###  Alternatives

[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

265866.9k1](/packages/codegreencreative-laravel-samlidp)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

61473.7k9](/packages/jeremy379-laravel-openid-connect)[salehhashemi/laravel-otp-manager

Laravel OTP manager

18813.9k](/packages/salehhashemi-laravel-otp-manager)[maicol07/laravel-oidc-client

OpenID Connect Client for Laravel

281.4k](/packages/maicol07-laravel-oidc-client)[lakm/nopass

Provides passwordless authentication for your laravel projects.

2216.7k3](/packages/lakm-nopass)[authlete/authlete-laravel

Authlete Library for Laravel

4226.5k](/packages/authlete-authlete-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
