2017 © Pedro Peláez
 

symfony-bundle simplesamlphp-bundle

SimpleSAMLphp Bundle for Symfony2

image

rozmarbeka/simplesamlphp-bundle

SimpleSAMLphp Bundle for Symfony2

  • Friday, November 4, 2016
  • by rozmarbeka
  • Repository
  • 1 Watchers
  • 0 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

SimplesamlphpBundle

This is a SimpleSAMLphp Bundle for Symfony2., (*1)

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

Installation

Add this bundle to your Symfony2 project., (*3)

composer require hslavich/simplesamlphp-bundle

or manually require this bundle in your composer.json file., (*4)

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

Update your project., (*5)

composer update hslavich/simplesamlphp-bundle

Activate the bundle in app/AppKernel.php., (*6)

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

Configuration

Add bundle configuration settings to your Symfony2 config., (*7)

# 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"., (*8)

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

    # 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, (*10)

    # 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, (*11)

    # 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., (*12)

# 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., (*13)

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" for more information., (*14)

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)., (*15)

Add the environment variable to your webserver configuration file, e.g. /etc/apache2/httpd.conf.local., (*16)

<Directory *>
    ...
    SetEnv SIMPLESAMLPHP_CONFIG_DIR /var/path/to/my/config
</Directory>

Enable session bridge storage (see Symfony documentation for more information)., (*17)

# 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)., (*18)

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

The Versions

04/11 2016

dev-master

9999999-dev

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

04/11 2016

v1.1.19

1.1.19.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

03/11 2016

v1.1.18

1.1.18.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

03/11 2016

v1.1.17

1.1.17.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.16

1.1.16.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.15

1.1.15.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.14

1.1.14.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.13

1.1.13.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.12

1.1.12.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

02/11 2016

v1.1.11

1.1.11.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

16/02 2016

dev-stable

dev-stable

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

16/02 2016

v1.1.0

1.1.0.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp

16/02 2016

v1.0.0

1.0.0.0

SimpleSAMLphp Bundle for Symfony2

  Sources   Download

The Requires

 

by Moritz Hesse
by Avatar hslavich

saml simplesamlphp