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

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

hslavich/simplesamlphp-bundle
=============================

SimpleSAMLphp Bundle for Symfony

v1.1.1(9y ago)22199.9k↓50%16[4 issues](https://github.com/hslavich/SimplesamlphpBundle/issues)PHP

Since Feb 16Pushed 8y ago4 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (5)Used By (0)

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

[](#simplesamlphpbundle)

This is a SimpleSAMLphp Bundle for Symfony.

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

**Note 2:** This bundle uses the full SimpleSAMLphp application. I highly recommend to use this lighter and improved [OneloginSamlBundle](https://github.com/hslavich/OneloginSamlBundle).

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

[](#installation)

Add this bundle to your Symfony 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 Symfony config.

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

```

You will need to create your own user provider. See the [Symfony 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 Symfony 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

38

—

LowBetter than 85% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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 ~174 days

Total

3

Last Release

3395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/96ab0e6c0e1228cadbe67257f26b34db04986d0af3178b7618e1badf39e34689?d=identicon)[hslavich](/maintainers/hslavich)

---

Top Contributors

[![hslavich](https://avatars.githubusercontent.com/u/1118225?v=4)](https://github.com/hslavich "hslavich (20 commits)")[![Tjeerd](https://avatars.githubusercontent.com/u/853463?v=4)](https://github.com/Tjeerd "Tjeerd (4 commits)")[![ptondereau](https://avatars.githubusercontent.com/u/4287777?v=4)](https://github.com/ptondereau "ptondereau (3 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/hslavich-simplesamlphp-bundle/health.svg)

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

###  Alternatives

[drupalauth/simplesamlphp-module-drupalauth

A SimpleSAMLphp module adding support for Drupal as the authentication source.

25305.4k1](/packages/drupalauth-simplesamlphp-module-drupalauth)[pdias/saml-bundle

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

1626.3k](/packages/pdias-saml-bundle)

PHPackages © 2026

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