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

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

abdicytus/laravel-sso
=====================

Laravel SSO Laravel Library Package

v1.7.9(7mo ago)01351MITPHPPHP ^8.0

Since Aug 29Pushed 7mo agoCompare

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

READMEChangelogDependencies (2)Versions (17)Used By (0)

Laravel SSO Client Package
==========================

[](#laravel-sso-client-package)

About Package
-------------

[](#about-package)

Laravel SSO is a package designed for client applications to integrate with a central portal application. The main feature of this package is SSO (Single Sign-On), which allows client applications to authenticate users through the portal rather than through the client application directly.

How This Package Works?
-----------------------

[](#how-this-package-works)

A client application that installs or uses this package will be fully authorized, meaning it cannot be accessed unless the user logs in via the portal.

When a user logs in from the portal to the client application, the portal sends a hash containing the user’s data to the client. The client application receives this data and verifies whether the user is registered or has permission within the client app.

- If the verification succeeds, the user will be logged in automatically.
- If it fails, the page will show an Unauthorized status and then redirect back to the portal after a few seconds.

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

[](#installation)

**Requirements**

This package requires the following:

- **PHP v8.0+**
- **Laravel v10.0+**
- **Filament v3.0+**

Open your terminal and install the package via Composer:

`composer require abdicytus/laravel-sso`

Wait for the installation process to complete.

Getting Started
---------------

[](#getting-started)

Open your **.env** file and add the following environment variables:

```
SSO_PORTAL_URL=https://portal-example.com   #example
SSO_SUCCESS_AUTH_REDIRECT=/dashboard        #example
API_TOKEN=4P1t0k3n123KnfjO                  #example

```

The **API\_TOKEN** can be obtained from the portal application once the client app is registered.

Next, open **App/Providers/Filament/AdminPanelProvider.php**, and import the middleware from the package:

`use OpenSynergic\LaravelSSO\Middleware\SsoRedirectMiddleware;`

Then, replace the `authMiddleware` from **`Authenticate::class`** with **`SsoRedirectMiddleware:class`**

```
->authMiddleware([
    SsoRedirectMiddleware::class
]);

```

To disable the SSO feature in the client application, add the following variable to your **.env** file and set its value to **false**. This variable is optional (by default, SSO is enabled).

`ENABLE_SSO=false`

Portal API
----------

[](#portal-api)

The portal application provides several API routes that can be accessed by the client application.

To access portal user data, use the API endpoints listed below. The base URL is the portal’s URL, and each request must include the header: **Authorization: Bearer *token***where ***token*** is the **API\_TOKEN** you defined in your **.env** file.

Available routes:

- **\[GET\]** `/api/users` — Retrieve all users from the portal
- **\[GET\]** `/api/user/{id} ` — Retrieve a specific user from the portal by ID

**Example: Fetching Data from** `/api/users`

Create a new controller, for example **UserClientController.php**, with the following content:

```
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;

class UserClientController extends Controller
{
    public function index(Request $request)
    {
        $baseUrl = config('app.services.base_url');
        $apiToken = config('app.services.api_token');
        $route = '/api/users'; // Fetch all users from the portal

        $page = $request->get('page', 1);
        $response = Http::withToken($apiToken)
            ->get($baseUrl . $route, ['page' => $page]);

        if($response->failed()) {
            abort(500, 'Failed to fetch data from portal')
        }

        return $reponse->json('data.data');
    }
}

```

Then, open **config/app.php**, and add the following configuration under **services**:

```
'services' => [
    'base_url' => env('SSO_PORTAL_URL'),
    'api_token' => env('API_TOKEN'),
]

```

Next, open **routes/web.php** and define a route for the controller you just created:

```
use App\Http\Controllers\UserClientController;

Route:get('/users', [UserClientController::class, 'index']);

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance65

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

16

Last Release

210d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36010f00bbf8c07b8ed2d4b4afd315bfe46afa3dde6d1326c0750356f96daf6f?d=identicon)[AbdiCytus](/maintainers/AbdiCytus)

---

Top Contributors

[![AbdiCytus](https://avatars.githubusercontent.com/u/120194748?v=4)](https://github.com/AbdiCytus "AbdiCytus (20 commits)")

### Embed Badge

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

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

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)

PHPackages © 2026

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