## SSO Riau SSO Riau Construct: ---- ```$php $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 : ---- ```$php use SsoRiau\SsoClientLibrary; $objSso = new SsoClientLibrary(); $objSso->ssoRequest(); ``` Consume SSO session : ---- ```$php 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; } ``` ```$php $url_back = {return_url}; $objSso = new SsoClientLibrary(); $objSso->ssoLogout($url_back); ```