vgno/silex-spid-provider

SPiD service provider for Silex

2.0.0 2015-02-24 11:54 UTC

README

Service provider making the SPiD PHP SDK available to your Silex application.

Build Status

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.

Setup instructions

Register the SPiD service provider in your Silex app like this;

$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;

$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.

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 (access for SPiD customers only).

License

Licensed under the MIT License, see LICENSE

Credits

Authored by Kristoffer Brabrand @ VG