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

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

n0izestr3am/laravel-sso
=======================

Simple Laravel SSO integration (Based on zefy/laravel-sso)

017PHP

Since Jul 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/n0izestr3am/laravel-sso)[ Packagist](https://packagist.org/packages/n0izestr3am/laravel-sso)[ RSS](/packages/n0izestr3am-laravel-sso/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Simple PHP SSO integration for Laravel
======================================

[](#simple-php-sso-integration-for-laravel)

This package based on [Simple PHP SSO integration for Laravel](https://github.com/zefy/laravel-sso) package.

### Requirements

[](#requirements)

- Laravel 6+
- PHP 7.3+

### Documentation

[](#documentation)

Please read [Simple PHP SSO integration for Laravel docs](https://github.com/zefy/laravel-sso).

Installation
============

[](#installation)

### Server

[](#server)

Install this package using composer.

```
$ composer require n0izestr3am/laravel-sso
```

Copy config file to Laravel project `config/` folder.

```
$ php artisan vendor:publish --provider="n0izestr3am\LaravelSSO\SSOServiceProvider"
```

Create table where all brokers will be saved.

```
$ php artisan migrate --path=vendor/n0izestr3am/laravel-sso/database/migrations
```

Edit your `app/Http/Kernel.php` by create new middleware like this:

```
'api' => [
    'throttle:60,1',
    'bindings',
],

'sso' => [
    \App\Http\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    'bindings',
],

//...
```

Now you should create brokers. You can create new broker using following Artisan CLI command:

```
$ php artisan sso:broker:create {name}
```

---

### Broker

[](#broker)

Install this package using composer.

```
$ composer require n0izestr3am/laravel-sso
```

Copy config file to Laravel project `config/` folder.

```
$ php artisan vendor:publish --provider="n0izestr3am\LaravelSSO\SSOServiceProvider"
```

Change `type` value in `config/laravel-sso.php` file from `server`to `broker`.

Set 3 new options in your `.env` file:

```
SSO_SERVER_URL=
SSO_BROKER_NAME=
SSO_BROKER_SECRET=
```

`SSO_SERVER_URL` is your server's http url without trailing slash. `SSO_BROKER_NAME` and `SSO_BROKER_SECRET` must be data which exists in your server's `brokers` table.

Edit your `app/Http/Kernel.php` by adding `\n0izestr3am\LaravelSSO\Middleware\SSOAutoLogin::class` middleware to `$routeMiddleware` array. It should look like this:

```
protected $routeMiddleware = [
    'auto_login' => \n0izestr3am\LaravelSSO\Middleware\SSOAutoLogin::class,
    //...
];
```

Then use like this: [![Use auto_login middleware](https://camo.githubusercontent.com/0f7ad52d521785a44a43850ba6a7583a174e8739ee49c751327a961d8dab617b/68747470733a2f2f692e696d6775722e636f6d2f317033425470312e706e67)](https://camo.githubusercontent.com/0f7ad52d521785a44a43850ba6a7583a174e8739ee49c751327a961d8dab617b/68747470733a2f2f692e696d6775722e636f6d2f317033425470312e706e67)

Last but not least, you need to edit `app/Http/Controllers/Auth/LoginController.php`. You should add two functions into `LoginController` class which will authenticate your client through SSO server but not your Broker page.

```
protected function attemptLogin(Request $request)
{
    $broker = new \n0izestr3am\LaravelSSO\LaravelSSOBroker;

    $credentials = $this->credentials($request);
    return $broker->login($credentials[$this->username()], $credentials['password']);
}

public function logout(Request $request)
{
    $broker = new \n0izestr3am\LaravelSSO\LaravelSSOBroker;

    $broker->logout();

    $this->guard()->logout();

    $request->session()->invalidate();

    return redirect('/');
}
```

That's all. For other Broker pages you should repeat everything from the beginning just changing your Broker name and secret in configuration file.

Example `.env` options:

```
SSO_SERVER_URL=https://server.test
SSO_BROKER_NAME=site1
SSO_BROKER_SECRET=892asjdajsdksja74jh38kljk2929023
```

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

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/15981920?v=4)[Noizestream](/maintainers/n0izestr3am)[@n0izestr3am](https://github.com/n0izestr3am)

---

Top Contributors

[![n0izestr3am](https://avatars.githubusercontent.com/u/15981920?v=4)](https://github.com/n0izestr3am "n0izestr3am (6 commits)")

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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