PHP code example of vgno / silex-spid-provider

1. Go to this page and download the library: Download vgno/silex-spid-provider 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/ */

    

vgno / silex-spid-provider example snippets


$app->register(new SPiDServiceProvider(), array(
    'spid.clientId'         => 'foobar',
    'spid.clientSecret'     => 'barfoo',
    'spid.clientSignSecret' => 'foobarsecret',
    'spid.redirectUri'      => 'http://example.com/auth/login',
    'spid.domain'           => 'example.com',
    'spid.cookie'           => true,
    'spid.production'       => false,
    'spid.https'            => true,
    'spid.apiVersion'       => 2
));

$response = $app['spid']->api('/user/123');