PHPackages                             rozmarbeka/simplesamlphp-bundle - 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. rozmarbeka/simplesamlphp-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

rozmarbeka/simplesamlphp-bundle
===============================

SimpleSAMLphp Bundle for Symfony2

v1.1.19(9y ago)0824PHP

Since Feb 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/rozmarbeka/SimplesamlphpBundle)[ Packagist](https://packagist.org/packages/rozmarbeka/simplesamlphp-bundle)[ RSS](/packages/rozmarbeka-simplesamlphp-bundle/feed)WikiDiscussions master Synced 3w ago

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

SimplesamlphpBundle
===================

[](#simplesamlphpbundle)

This is a SimpleSAMLphp Bundle for Symfony2.

**Note:** For Symfony 2.7 or lower, you need to use the 1.0.0 release of this bundle.

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

[](#installation)

Add this bundle to your Symfony2 project.

```
composer require hslavich/simplesamlphp-bundle

```

or manually require this bundle in your `composer.json` file.

```
"require": {
    ...
    "hslavich/simplesamlphp-bundle": "dev-master"
}

```

Update your project.

```
composer update hslavich/simplesamlphp-bundle

```

Activate the bundle in `app/AppKernel.php`.

```
$bundles = array(
    ...
    new Hslavich\SimplesamlphpBundle\HslavichSimplesamlphpBundle(),
)

```

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

[](#configuration)

Add bundle configuration settings to your Symfony2 config.

```
# app/config/config.yml
hslavich_simplesamlphp:
    # Service provider name
    sp: default-sp

```

You will need to create your own user provider. See the [Symfony2 documentation "How to Create a custom User Provider"](http://symfony.com/doc/current/cookbook/security/custom_provider.html).

1. First, create a User class (you can also place it in your `Entity/` folder)

    ```
     # src/Acme/MyBundle/Security/User/MyUser.php
     namespace Acme\MyBundle\Security\User;

     use Symfony\Component\Security\Core\User\UserInterface;
     use Symfony\Component\Security\Core\User\EquatableInterface;

     class MyUser implements UserInterface, EquatableInterface
     {
         ...
     }

    ```
2. Then create the UserProvider class

    ```
     # src/Acme/MyBundle/Security/User/MyUserProvider.php
     namespace Acme\MyBundle\Security\User;

     use Symfony\Component\Security\Core\User\UserProviderInterface;
     use Symfony\Component\Security\Core\User\UserInterface;
     use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
     use Symfony\Component\Security\Core\Exception\UnsupportedUserException;

     class MyUserProvider implements UserProviderInterface
     {
         public function loadUserByUsername($username) { ... }
         public function refreshUser(UserInterface $user) { ... }
         public function supportsClass($class) { ... }
     }

    ```
3. And make your `UserProvider` a service

    ```
     # src/Acme/MyBundle/Resources/config/services.yml
     services:
         my_user_provider:
             class: Acme\MyBundle\Security\User\MyUserProvider

    ```

Then add the `provider` and `firewalls` settings to you Symfony2 security file.

```
# app/config/security.yml
security:
    providers:
        simplesaml:
            id: my_user_provider

    firewalls:
        saml:
            pattern:    ^/
            anonymous: true
            stateless:  true
            simple_preauth:
                authenticator: simplesamlphp.authenticator
                provider: simplesaml
            logout:
                path:   /logout
                success_handler: simplesamlphp.logout_handler

```

Create the following file structure in your `app/` folder and place your configuration files in there.

```
app/
  config/
    simplesamlphp/
      cert/
        saml.crt
        saml.pem
      config/
        config.php
        authsources.php
      metadata/
        saml20-idp-remote.php # Example

```

Make sure to correctly set the paths for `cert/` and `metadata/` folders in your `config.php` file (absolute paths recommended). The `metadata/saml20-idp-remote.php` is just an example. See the [SimpleSAMLphp documentation, "Adding IdPs to the SP"](https://simplesamlphp.org/docs/stable/simplesamlphp-sp#section_2) for more information.

You may also place those folders anywhere else on your machine, just make sure to correctly set the `SIMPLESAMLPHP_CONFIG_DIR` environment variable (see below).

Add the environment variable to your webserver configuration file, e.g. `/etc/apache2/httpd.conf.local`.

```

    ...
    SetEnv SIMPLESAMLPHP_CONFIG_DIR /var/path/to/my/config

```

Enable session bridge storage (see [Symfony documentation](http://symfony.com/doc/current/cookbook/session/php_bridge.html) for more information).

```
# app/config/config.yml
framework:
    session:
        storage_id: session.storage.php_bridge
        handler_id: ~

```

Create an alias on your webserver, e.g. for an Apache2 webserver, add this line to you `http.conf.local` (or other desired configuration file).

```
Alias /simplesaml /home/myapp/vendor/simplesamlphp/simplesamlphp/www

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 51.7% 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 ~26 days

Recently: every ~0 days

Total

11

Last Release

3524d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6057c662d0a3360243d50535e18b667155eb46d12f204e70d79f3f01288ee8c2?d=identicon)[rozmarbeka](/maintainers/rozmarbeka)

---

Top Contributors

[![hslavich](https://avatars.githubusercontent.com/u/1118225?v=4)](https://github.com/hslavich "hslavich (15 commits)")[![rozmarbeka](https://avatars.githubusercontent.com/u/1408517?v=4)](https://github.com/rozmarbeka "rozmarbeka (7 commits)")[![Tjeerd](https://avatars.githubusercontent.com/u/853463?v=4)](https://github.com/Tjeerd "Tjeerd (4 commits)")[![dialogik](https://avatars.githubusercontent.com/u/1260548?v=4)](https://github.com/dialogik "dialogik (2 commits)")[![losullivansu](https://avatars.githubusercontent.com/u/124787731?v=4)](https://github.com/losullivansu "losullivansu (1 commits)")

---

Tags

samlsimplesamlphp

### Embed Badge

![Health badge](/badges/rozmarbeka-simplesamlphp-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/rozmarbeka-simplesamlphp-bundle/health.svg)](https://phpackages.com/packages/rozmarbeka-simplesamlphp-bundle)
```

###  Alternatives

[onelogin/php-saml

PHP SAML Toolkit

1.3k46.5M134](/packages/onelogin-php-saml)[aacotroneo/laravel-saml2

A Laravel package for Saml2 integration as a SP (service provider) for multiple IdPs, based on OneLogin toolkit which is much more lightweight than simplesamlphp.

5694.6M](/packages/aacotroneo-laravel-saml2)[hslavich/simplesamlphp-bundle

SimpleSAMLphp Bundle for Symfony

22199.9k](/packages/hslavich-simplesamlphp-bundle)[surfnet/stepup-saml-bundle

A Symfony 7 bundle that integrates the simplesamlphp\\saml2 library with Symfony.

14102.0k3](/packages/surfnet-stepup-saml-bundle)[pdias/saml-bundle

The SamlBundle adds support for SAML 2.0 Service Provider in Symfony.

1627.6k](/packages/pdias-saml-bundle)[adactive-sas/saml2-bridge-bundle

Symfony bundle that provide a SAML Identity Provider (idp).

123.5k](/packages/adactive-sas-saml2-bridge-bundle)

PHPackages © 2026

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