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

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

deroy2112/laravel-synology-sso
==============================

Laravel Socialite driver for Synology SSO (OIDC) with PKCE S256, ID token verification, and group-to-role mapping

v1.2.1(1mo ago)033MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Nov 2Pushed 1mo agoCompare

[ Source](https://github.com/Deroy2112/laravel-synology-sso)[ Packagist](https://packagist.org/packages/deroy2112/laravel-synology-sso)[ RSS](/packages/deroy2112-laravel-synology-sso/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (17)Versions (8)Used By (0)

Laravel Synology SSO
====================

[](#laravel-synology-sso)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dd448a125d56931cc6bbab9624c36dcd79ddfb7ecbfac9629993801d48f968b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465726f79323131322f6c61726176656c2d73796e6f6c6f67792d73736f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deroy2112/laravel-synology-sso)[![Total Downloads](https://camo.githubusercontent.com/9cba0a15af2a66939aaa9d73ab8e13ad79c02f646ed90e5af73dd9e6f01b1742/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6465726f79323131322f6c61726176656c2d73796e6f6c6f67792d73736f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deroy2112/laravel-synology-sso)[![License](https://camo.githubusercontent.com/f6b8a54e0c8c5a3386fa0007a10b4956670cdec3c5f30d25d19d9bbc6a05133f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465726f79323131322f6c61726176656c2d73796e6f6c6f67792d73736f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deroy2112/laravel-synology-sso)

A [Laravel Socialite](https://laravel.com/docs/socialite) driver for Synology SSO Server. It speaks OIDC with auto-discovery, uses PKCE (S256) and a nonce, verifies the ID token signature (RS256/JWKS) and claims, and can map Synology groups to your app's roles.

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

[](#requirements)

- PHP 8.2+
- Laravel 12 or 13
- A Synology DSM with the SSO Server package, reachable over HTTPS

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

[](#installation)

```
composer require deroy2112/laravel-synology-sso
php artisan synology-sso:install
```

The install command publishes `config/synology-sso.php`, optionally copies the docs into your app, and prints an `.env` template.

### Configuration

[](#configuration)

Set at least these in `.env`:

```
SYNOLOGY_SSO_HOST=https://sso.example.com/webman/sso
SYNOLOGY_SSO_CLIENT_ID=your-client-id
SYNOLOGY_SSO_CLIENT_SECRET=your-client-secret
SYNOLOGY_SSO_REDIRECT_URI="${APP_URL}/auth/synology/callback"
```

`SYNOLOGY_SSO_HOST` is the SSO Server's Well-Known URL with `/.well-known/openid-configuration` removed — find it under **DSM → SSO Server → Services → OIDC**. Everything else (group mapping, allowed groups, SSL verification, cache TTL, clock-skew leeway) lives in the published config file; see [docs/CONFIGURATION.md](docs/CONFIGURATION.md).

On the Synology side, register the app under **SSO Server → Application Portal**with the redirect URI above and the scopes `openid`, `email`, `groups`.

Usage
-----

[](#usage)

```
use Deroy2112\LaravelSynologySso\GroupRoleMapper;
use Deroy2112\LaravelSynologySso\UserProvisioner;
use Illuminate\Support\Facades\Auth;
use Laravel\Socialite\Facades\Socialite;

Route::get('/auth/synology', fn () => Socialite::driver('synology')->redirect());

Route::get('/auth/synology/callback', function (UserProvisioner $provisioner, GroupRoleMapper $mapper) {
    $ssoUser = Socialite::driver('synology')->user();

    if (! $mapper->hasAccess($ssoUser->groups)) {
        abort(403);
    }

    // Find or create the local user (honours auto_create_users / user_model).
    $user = $provisioner->provision($ssoUser);

    // Laravel has no built-in roles, so assign them however your app does,
    // e.g. with spatie/laravel-permission:
    // $user->syncRoles($mapper->mapGroupsToRoles($ssoUser->groups));

    Auth::login($user);

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

`$ssoUser` exposes the usual Socialite fields (`id` from the `sub` claim, `name`, `email`) plus `groups`. Synology group names are bare (`administrators`, `users`) without LDAP, or suffixed (`administrators@example.com`) with a domain — map both forms if you support both.

Token lifetime
--------------

[](#token-lifetime)

Synology issues short-lived tokens (180s by default) and no refresh tokens. That is a server-side limit, not a driver bug; you can raise it on the NAS. See [docs/SYNOLOGY\_QUIRKS.md](docs/SYNOLOGY_QUIRKS.md).

Documentation
-------------

[](#documentation)

- [Configuration](docs/CONFIGURATION.md)
- [Synology quirks](docs/SYNOLOGY_QUIRKS.md)
- [Developer reference](docs/DEVELOPER_REFERENCE.md)
- [API response examples](docs/API_RESPONSES.md)
- [Security checklist](docs/SECURITY_CHECKLIST.md)

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

Security
--------

[](#security)

Report vulnerabilities privately through [GitHub Security Advisories](https://github.com/Deroy2112/laravel-synology-sso/security/advisories/new), not public issues.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Recently: every ~55 days

Total

7

Last Release

59d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/81692934?v=4)[deroy](/maintainers/Deroy2112)[@Deroy2112](https://github.com/Deroy2112)

---

Top Contributors

[![Deroy2112](https://avatars.githubusercontent.com/u/81692934?v=4)](https://github.com/Deroy2112 "Deroy2112 (27 commits)")

---

Tags

laravelAuthenticationSSOsocialiteoidcpkcesynology

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

28.0k175.2k9](/packages/bagisto-bagisto)[google/auth

Google Auth Library for PHP

1.4k302.1M240](/packages/google-auth)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[statamic/cms

The Statamic CMS Core Package

4.9k3.8M1.2k](/packages/statamic-cms)[ellaisys/aws-cognito

Laravel Authentication using AWS Cognito (Web and API)

121269.8k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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