mijndomein/dreamcommerce-sso-client

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.3.2) of this package.

A single sign on client for a dreamcommerce webshop

0.3.2 2016-05-20 12:10 UTC

This package is not auto-updated.

Last update: 2018-06-10 13:57:08 UTC


README

Build Status

To test this run the following script in the root of the project:

<?php
require_once "vendor/autoload.php";

use GuzzleHttp\Client as GuzzleClient;
use DreamCommerce\SingleSignOn\Ip;
use DreamCommerce\SingleSignOn\SignOnMode;
use DreamCommerce\SingleSignOn\TimeProvider;
use DreamCommerce\SingleSignOn\SingleSignOnClient;

// Please change the following values for testing
// string hardcoded in the application code, provided by DC
$serverSalt = 'salt';
$shopDomain = 'domain-of-your.shop';
// string generated by MD and passed as one of the parameters to "createLicense" api call (should be unique for every shop)
$ssoHash = 'sso-hash-for-your-shop';



$client = new SingleSignOnClient(
    new GuzzleClient(),
    new TimeProvider,
    $serverSalt,
    'console/plugin/execute/plugin/LmsSSO-SSO/act/handshake/token',
    10
);


$handShakeUrl = $client->requestHandshakeUrl(
    SignOnMode::asUser(),
    new Ip(file_get_contents('http://api.ipify.org')),
    $shopDomain,
    $ssoHash
);
echo $handShakeUrl;