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

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

cleaniquecoders/laravel-config-sso
==================================

Database-backed SSO provider configuration for Laravel with a Livewire + Flux admin UI.

1.0.1(yesterday)00MITPHPPHP ^8.2CI passing

Since Jun 8Pushed yesterdayCompare

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

READMEChangelog (2)Dependencies (21)Versions (3)Used By (0)

Laravel Config SSO
==================

[](#laravel-config-sso)

[![Latest Version on Packagist](https://camo.githubusercontent.com/68e5e4225757c24385ee67966f04cc2a15bfca1376a0f68e8976d5afc8a5dcb9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65616e69717565636f646572732f6c61726176656c2d636f6e6669672d73736f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/laravel-config-sso)[![GitHub Tests Action Status](https://github.com/cleaniquecoders/laravel-config-sso/actions/workflows/run-tests.yml/badge.svg)](https://github.com/cleaniquecoders/laravel-config-sso/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://github.com/cleaniquecoders/laravel-config-sso/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/cleaniquecoders/laravel-config-sso/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/44fd5d0ad453957aba4fd6b9e618f532cbb3910e81be66c1fcbc3473736239fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c65616e69717565636f646572732f6c61726176656c2d636f6e6669672d73736f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cleaniquecoders/laravel-config-sso)

Manage **single sign-on (SSO) identity providers from your database** — no `.env` juggling, no redeploys. Providers (Google, GitHub, GitLab, Bitbucket, Keycloak, Azure AD) are stored with an **encrypted client secret** and per-driver config, exposed through a [Laravel Socialite](https://laravel.com/docs/socialite)redirect/callback flow that finds-or-creates and links the local user — plus an optional **Livewire + Flux** admin screen to manage them.

- 🔐 DB-backed providers, encrypted `client_secret` and OAuth `token_data`
- 🧩 Core drivers via `laravel/socialite`; Keycloak / Azure via optional `socialiteproviders/*`
- 🖥️ Optional Livewire 4 + Flux admin UI (create / edit / enable / delete)
- 🧱 App-agnostic — configurable user model, table names, and authorization gate
- ✅ Laravel **12 &amp; 13**, PHP **8.2+**

Quickstart
----------

[](#quickstart)

```
composer require cleaniquecoders/laravel-config-sso

# Publishes the config, publishes + runs the migrations, all in one step
php artisan config-sso:install
```

Then:

1. Point the package at your user model and the gate that guards the admin UI in `config/config-sso.php`:

    ```
    'user_model' => App\Models\User::class,
    'gate'       => 'admin.manage.sso',   // or null to disable the check
    ```
2. Drop the login buttons into your login view — no extra markup required:

    ```

    ```
3. (Optional) install the admin UI and extra drivers:

    ```
    composer require livewire/livewire livewire/flux                 # admin UI
    composer require socialiteproviders/keycloak socialiteproviders/microsoft-azure   # Keycloak / Azure AD
    ```

That's it — add a provider in the admin screen (or seed `SsoProvider` directly) and it appears on your login page.

Installation (manual)
---------------------

[](#installation-manual)

If you prefer not to use the installer:

```
php artisan vendor:publish --tag="laravel-config-sso-migrations" && php artisan migrate
php artisan vendor:publish --tag="laravel-config-sso-config"
php artisan vendor:publish --tag="laravel-config-sso-views"   # optional — customize the UI
```

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

[](#configuration)

Set the host application's user model and the gate that protects the admin UI:

```
// config/config-sso.php
'user_model' => App\Models\User::class,
'gate'       => 'admin.manage.sso',   // or null to disable the check
```

Everything else (drivers, table names, redirect routes, registration behaviour, route prefixes/middleware) is documented inline in the published config file.

Usage
-----

[](#usage)

### Render login buttons

[](#render-login-buttons)

The bundled `` Blade component renders provider buttons (Tailwind-styled, dark-mode ready, no Flux dependency so it's safe on a public login page):

```
                              {{-- all active providers --}}
           {{-- a single provider --}}
      {{-- a subset, in the given order --}}
                 {{-- merge your own classes --}}
```

> The tag is configurable via `config-sso.component` (default `sso`) — set it to another name to avoid clashes, or `null` to not register a global tag.

Or build the markup yourself with the facade:

```
@foreach (\CleaniqueCoders\ConfigSso\Facades\ConfigSso::providers() as $provider)
    Continue with {{ $provider->name }}
@endforeach
```

`sso.redirect` and `sso.callback` are registered automatically. On callback the package finds a user by email (creating one when `registration.enabled` is true), links the identity, stores the tokens, logs the user in, and redirects to the `redirect.home` route.

### Admin UI

[](#admin-ui)

When Livewire is installed, a full-page management screen is registered at `config-sso.admin.prefix` (default `admin/settings/sso`). Or embed it anywhere:

```

```

### The `ConfigSso` facade

[](#the-configsso-facade)

```
ConfigSso::enabled();              // bool — master feature toggle
ConfigSso::providers();            // Collection — active, ordered
ConfigSso::drivers();              // ['google' => 'Google', ...]
ConfigSso::driverFields('keycloak'); // ['base_url', 'realms']
```

Testing
-------

[](#testing)

```
composer test
```

The suite (Pest + Orchestra Testbench) covers the models, the redirect/callback flow (Socialite mocked), the `ConfigSso` facade, the Livewire admin component, the ``component, and a full **end-to-end sign-in journey** (`tests/Feature/EndToEndTest.php`).

Local development (try it in a real app)
----------------------------------------

[](#local-development-try-it-in-a-real-app)

A [Testbench workbench](https://packages.tools/testbench) app lives in `workbench/` so you can click through the package in a browser without wiring it into a host project:

```
composer install
composer serve
```

`composer serve` builds a SQLite database, runs the migrations, seeds demo data, and boots the app at `http://127.0.0.1:8000`. Then:

- **`/`** — the login page rendering ``
- **`/dev/login`** — log in as the seeded admin (`admin@example.com` / `password`)
- **`/admin/settings/sso`** — the Livewire + Flux admin UI

> Seeded providers use placeholder credentials, so clicking a button reaches the real IdP and fails at *their* end — edit a provider with real `client_id` / `client_secret` to complete a full OAuth round trip. Run `composer build` any time to reset the demo database.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Nasrul Hazim Bin Mohamad](https://github.com/nasrulhazim)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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 ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b57069d0f4b634f65eccc6e5d5848990e25968d45ec2cf46d626c6a4658f944b?d=identicon)[nasrulhazim.m](/maintainers/nasrulhazim.m)

---

Top Contributors

[![nasrulhazim](https://avatars.githubusercontent.com/u/10341422?v=4)](https://github.com/nasrulhazim "nasrulhazim (8 commits)")

---

Tags

fluxlaravellivewireoauthoidcsocialitessolaravelCleanique Coderslaravel-config-sso

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

436834.4k1](/packages/clickbar-laravel-magellan)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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