1. Go to this page and download the library: Download sksso/smartsso-postgresql library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sksso / smartsso-postgresql example snippets
HTML+PHP
private $sdkSSO;
public function __construct() {
//inisialisasi konfigurasi SSO
$this->sdkSSO = new SDKlrvlSSO();
$this->sdkSSO->setEnv([ALIAS_ID], [SECRET_KEY_BODY], [SECRET_KEY_URL]);
....
HTML+PHP
public function ekstrakData(){
$data = file_get_contents('php://input');
return $this->sdkSSO->ekstrakDataCredentials($data);
}
HTML+PHP
public function login(Request $request, $param){
$dataUsers = $this->sdkSSO->cekTiket($param);
if($dataUsers) //output data kredensial pengguna format array
{
Auth::loginUsingId($dataUsers['id']); //auth login by ID
return redirect()->route('home'); //kondisi setelah user dapat login
}
}
HTML+PHP
$this->sdkSSO->logout();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.