PHPackages                             sobiz/laravel-sso - 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. sobiz/laravel-sso

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

sobiz/laravel-sso
=================

Single Sign-On package for Sobiz applications using OAuth 2.0 + OIDC

041↓50%PHP

Since Feb 16Pushed 2mo agoCompare

[ Source](https://github.com/Lakpasherpa9/sobiz-sso)[ Packagist](https://packagist.org/packages/sobiz/laravel-sso)[ RSS](/packages/sobiz-laravel-sso/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sobiz Laravel SSO
=================

[](#sobiz-laravel-sso)

A lightweight Single Sign-On (SSO) package for Laravel applications, enabling seamless authentication with Sobiz MyProfile (OAuth 2.0 + OIDC).

Features
--------

[](#features)

- Easy installation and configuration.
- Seamless integration with Sobiz SSO server.
- Built-in middleware for protecting routes.
- Pre-configured login buttons and views.
- Clean uninstallation process.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^10.0 or ^11.0

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

[](#installation)

### 1. Install the package via composer

[](#1-install-the-package-via-composer)

```
composer require sobiz/laravel-sso
```

### 2. Run the installation command

[](#2-run-the-installation-command)

The installation command will publish the configuration file, migrations, and views. It will also add the necessary environment variables to your `.env` file.

```
php artisan sso:install
```

### 3. Register your application

[](#3-register-your-application)

Go to [Sobiz MyProfile Admin](https://myprofile.sobiz.com/admin/oauth-clients) and register your application to get your `Client ID` and `Client Secret`.

### 4. Update your .env file

[](#4-update-your-env-file)

Ensure the following variables are correctly set in your `.env` file:

```
SSO_AUTH_SERVER_URL=https://myprofile.sobiz.com
SSO_CLIENT_ID=your-client-id
SSO_CLIENT_SECRET=your-client-secret
SSO_REDIRECT_URI=https://your-app.com/auth/sso/callback
SSO_SESSION_DOMAIN=your-app-domain.com
```

Usage
-----

[](#usage)

### Middleware

[](#middleware)

Protect your routes using the `sso.auth` middleware:

```
Route::middleware(['sso.auth'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});
```

### Login Button

[](#login-button)

Add the pre-styled SSO login button to your login page:

```
@include('sso::login-button')
```

### SSO Facade

[](#sso-facade)

You can use the `SSO` facade to access user information or handle logout:

```
use Sobiz\LaravelSSO\Facades\SSO;

// Get the authenticated SSO user
$user = SSO::user();

// Logout
SSO::logout();
```

Uninstallation
--------------

[](#uninstallation)

To remove the package resources (config, views, migrations, and environment variables) from your application, run:

```
php artisan sso:uninstall
```

Warning

This command will delete published files and remove SSO variables from your `.env`. If you have already run migrations, remember to roll them back manually before running this command if you wish to remove the database tables.

After running the uninstall command, you can remove the package from composer:

```
composer remove sobiz/laravel-sso
```

Troubleshooting
---------------

[](#troubleshooting)

- **Invalid state parameter**: Ensure that your `SESSION_DOMAIN` in `.env` matches the domain you are visiting, and that your `APP_URL` matches your actual serving URL (including port if on localhost).
- **Redirection loop**: Check if the `SSO_REDIRECT_URI` is correctly registered in both your application `.env` and the MyProfile admin portal.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance56

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/87270447?v=4)[Lakpa Sherpa](/maintainers/Lakpasherpa9)[@Lakpasherpa9](https://github.com/Lakpasherpa9)

---

Top Contributors

[![Lakpasherpa9](https://avatars.githubusercontent.com/u/87270447?v=4)](https://github.com/Lakpasherpa9 "Lakpasherpa9 (3 commits)")

### Embed Badge

![Health badge](/badges/sobiz-laravel-sso/health.svg)

```
[![Health](https://phpackages.com/badges/sobiz-laravel-sso/health.svg)](https://phpackages.com/packages/sobiz-laravel-sso)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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