Download zip Select Archive Format
Name Last Update history
File dir src Loading commit data...
File txt README.md Loading commit data...
File txt composer.json Loading commit data...

README.md

SSO Riau

SSO Riau

Construct:

$this->clientId = '';   // 3rd Party client Id
$this->clientSecret = '';   // 3rd Party client secret
$this->redirectUri = '';  // 3rd Party url redirect or url to handle callback
$this->targetUri = 'https://sso.riau.go.id/';    // SSO Riau portal

Check SSO session :

use SsoRiau\SsoClientLibrary;
$objSso = new SsoClientLibrary();
$objSso->ssoRequest();

Consume SSO session :

use SsoRiau\SsoClientLibrary;
$objSso = new SsoClientLibrary();
$data_access_token = $objSso->ssoCallback();
if (!empty($data_access_token)) {
    $data_access_token = json_decode($data_access_token);
    $access_token = $data_access_token->access_token; // store access_token within the session if needed?
}

if ($access_token != '') {
    //fetch ssoUserInfo
    $ssoUserInfo = $objSso->ssoUserInfo($access_token);
    $ssoUserInfo = json_decode($ssoUserInfo);
    $email = $ssoUserInfo->email;
}

$url_back = {return_url};
$objSso = new SsoClientLibrary();
$objSso->ssoLogout($url_back);