PHPackages                             gl-events/sylius-admin-saml-plugin - 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. gl-events/sylius-admin-saml-plugin

ActiveSylius-plugin[Authentication &amp; Authorization](/categories/authentication)

gl-events/sylius-admin-saml-plugin
==================================

SAML auth SSO plugin for Sylius.

2.0.0(1mo ago)53.5k↓41.9%[7 PRs](https://github.com/GL-EVENTS/SyliusAdminSamlPlugin/pulls)MITPHPPHP ^8.3CI passing

Since Nov 28Pushed 2w agoCompare

[ Source](https://github.com/GL-EVENTS/SyliusAdminSamlPlugin)[ Packagist](https://packagist.org/packages/gl-events/sylius-admin-saml-plugin)[ RSS](/packages/gl-events-sylius-admin-saml-plugin/feed)WikiDiscussions 2.x Synced 2w ago

READMEChangelog (10)Dependencies (95)Versions (21)Used By (0)

GL events SyliusAdminSamlPlugin
===============================

[](#gl-events-syliusadminsamlplugin)

Features
--------

[](#features)

This plugin allow your admin users to sign in with SAML providers (Google, Azure, Okta, etc.)

 [![Form admin login](docs/login.png)](docs/login.png)

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

[](#installation)

1. Add the bundle to your `composer.json` file:

```
   composer require gl-events/sylius-admin-saml-plugin
   composer require onelogin/php-saml
```

2. Add the plugin class to your `config/bundles.php` file:

```
    return [
        ...
        GlEvents\SyliusAdminSamlPlugin\GlEventsSyliusAdminSamlPlugin::class => ['all' => true],
    ];
```

3. Import the plugin defaults (registers the SSO button hook and the login-page Twig globals):

```
# config/packages/gl_events_sylius_admin_saml.yaml

imports:
    - { resource: "@GlEventsSyliusAdminSamlPlugin/config/config.yaml" }
```

4. Configure the plugin. Everything is set through the bundle configuration, no dedicated env vars are required. Generate the SP private key with `openssl genpkey -algorithm RSA -out private.key`:

```
# config/packages/gl_events_sylius_admin_saml.yaml

gl_events_sylius_admin_saml:
    idp:
        entity_id: 'https://idp.example.com/metadata'
        sso_url: 'https://idp.example.com/sso'
        slo_url: 'https://idp.example.com/slo'   # optional
        certificate: 'MIID...'
    sp:
        private_key: |
            -----BEGIN PRIVATE KEY-----
            ...
            -----END PRIVATE KEY-----
    identifier_key: 'email'   # SAML attribute holding the admin user email
    proxy_vars: false         # true when behind an SSL-terminating reverse proxy
    admin_login: true         # show the traditional Sylius admin login form
    sso_login: true           # show the SSO login button
```

Every setting is optional and defaults to an empty string (`proxy_vars` to `false`, `admin_login`/`sso_login` to `true`); a missing SAML setting simply makes the SSO login fail at runtime (flash + redirect back to the login page), it never breaks the app boot. Any value may still reference an env var if you prefer, e.g. `certificate: '%env(SAML_IDP_CERTIFICATE)%'`.

5. Wrap the traditional admin login form so it can be toggled with `admin_login`.

    The plugin does not override the core Sylius admin login hooks (a plugin must never override the host app's defaults). Gate the whole form with a single hook override in `config/packages/sylius_twig_hooks.yaml`:

```
sylius_twig_hooks:
    hooks:
        'sylius_admin.security.login.page.content':
            form:
                template: '@GlEventsSyliusAdminSamlPlugin/Security/login/page/content/form/_traditional.html.twig'
                context:
                    wrapped: '@SyliusAdmin/security/login/page/content/form.html.twig'
```

This wraps the entire `` (fields + CSRF) in the `admin_login` condition, so in SSO-only mode the form disappears cleanly. The SSO button hook is provided by the plugin on the sibling `sylius_admin.security.login.page.content` hook, so it stays visible regardless.

6. Add in your `config/security.yaml` file:

```
        providers:
            saml_provider:
              id: gl_events.saml_plugin.provider.saml_user
        firewalls:
              saml:
                    pattern: ^/saml
                    stateless: true
                    custom_authenticator: gl_events.saml_plugin.security.saml_authenticator
              main:
                    lazy: true
                    provider: saml_provider
        access_control:
              - { path: "%sylius.security.admin_regex%/saml", role: ROLE_SUPER_ADMIN }
              - { path: "%sylius.security.admin_regex%/login/saml", role: PUBLIC_ACCESS }
              - { path: "%sylius.security.admin_regex%/login/saml/logout", role: PUBLIC_ACCESS }
              - { path: "%sylius.security.admin_regex%/login/saml/acs", role: PUBLIC_ACCESS }
              - { path: "%sylius.security.admin_regex%/login/saml/sls", role: PUBLIC_ACCESS }
              - { path: "%sylius.security.admin_regex%/login/saml/metadata", role: PUBLIC_ACCESS }
```

7. Add in your `config/routes.yaml` file:

```
   glevents_sylius_admin_saml_plugin:
        resource: "@GlEventsSyliusAdminSamlPlugin/config/routing.yaml"
```

8. If your application runs behind a reverse proxy (load balancer, Kubernetes ingress, etc.) that terminates SSL, set `proxy_vars: true` in your `gl_events_sylius_admin_saml` config:

```
gl_events_sylius_admin_saml:
    proxy_vars: true
```

This tells the `onelogin/php-saml` library to read `X-Forwarded-Proto`, `X-Forwarded-Host` and `X-Forwarded-Port` headers when building the current URL for SAML response validation. Without this, the library detects `http://` instead of `https://` and rejects the SAML response with an error like *"The response was received at http://... instead of https://..."*.

Also verify your Symfony `trusted_proxies` and `trusted_headers` settings so that `$request->getScheme()` also returns the correct scheme, see:

9. You are now ready to go ! 🚀

Credits
-------

[](#credits)

Developed by [GL Events](https://gl-events.com/).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance95

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~42 days

Recently: every ~6 days

Total

15

Last Release

43d ago

Major Versions

1.x-dev → 2.0.02026-07-08

PHP version history (2 changes)1.0.0PHP ^8.1

1.2.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49161697?v=4)[Arthur\_ELS](/maintainers/arthurels69)[@arthurels69](https://github.com/arthurels69)

---

Top Contributors

[![arthurels69](https://avatars.githubusercontent.com/u/49161697?v=4)](https://github.com/arthurels69 "arthurels69 (7 commits)")[![Gbassot118](https://avatars.githubusercontent.com/u/180548168?v=4)](https://github.com/Gbassot118 "Gbassot118 (1 commits)")

---

Tags

syliusSSOsamlsylius-plugin

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gl-events-sylius-admin-saml-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/gl-events-sylius-admin-saml-plugin/health.svg)](https://phpackages.com/packages/gl-events-sylius-admin-saml-plugin)
```

###  Alternatives

[onelogin/php-saml

PHP SAML Toolkit

1.3k49.0M156](/packages/onelogin-php-saml)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

265866.9k1](/packages/codegreencreative-laravel-samlidp)[hslavich/oneloginsaml-bundle

OneLogin SAML Bundle for Symfony

1492.6M1](/packages/hslavich-oneloginsaml-bundle)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

281162.9k](/packages/scaler-tech-laravel-saml2)[humanmade/wp-simple-saml

WordPress Simple SAML plugin

126313.0k6](/packages/humanmade-wp-simple-saml)[nbgrp/onelogin-saml-bundle

OneLogin SAML Symfony Bundle

551.4M](/packages/nbgrp-onelogin-saml-bundle)

PHPackages © 2026

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