PHP code example of giak / shibboleth-bundle

1. Go to this page and download the library: Download giak/shibboleth-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

giak / shibboleth-bundle example snippets



// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Giak\ShibbolethBundle\GiakShibbolethBundle(),
        // ...
    );
}

namespace MyBundle\Security\User;

class User implements UserInterface
{
...
}

namespace MyBundle\Security\User;

use Giak\ShibbolethBundle\Security\User\ShibbolethUserProviderInterface;

class MyShibbolethUserProvider extends ShibbolethUserProviderInterface
{
    public function loadUser(array $credentials)
    {
        $user = new User();
        $user->setMail($credentials['mail']);
        ...
        return $user;
    }
    
    public function refreshUser(UserInterface $user)
    {
        return $user;
    }
}

security:
    providers:
        shibboleth:
            id: MyBundle\Security\User\MyShibbolethUserProvider