SPiD service provider for Silex
Service provider making the SPiD PHP SDK available to your Silex application., (*1)
, (*2)
Installation
Add "vgno/silex-spid-provider": "XXX"
to the composer.json file inside your project and do a composer install
. Check Composer for the latest available version., (*3)
Setup instructions
Register the SPiD service provider in your Silex app like this;, (*4)
$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
));
Usage
After registering the SPiD service provider, the VGS_Client instance can be accessed from the $app
variable like this;, (*5)
$response = $app['spid']->api('/user/123');
Tests
The service provider comes with PHPUnit tests and can be run by doing a ./vendor/phpunit/phpunit/phpunit
inside the silex-spid folder., (*6)
Documentation
See more documentation and examples at the spid-php-sdk page (maintained by Schibsted Payment) at github.com/schibsted/spid-php-examples and [techdocs.spid.no][3] (access for SPiD customers only)., (*7)
License
Licensed under the MIT License, see LICENSE, (*8)
Credits
Authored by Kristoffer Brabrand @ VG, (*9)