PHP code example of alfaqosry / sso-clientup

1. Go to this page and download the library: Download alfaqosry/sso-clientup 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/ */

    

alfaqosry / sso-clientup example snippets


use Alfaqosry\SsoClientup\SsoClient;

$sso = new SsoClient();

// Login user
$response = $sso->login('username', 'password');

if ($response->success) {
    echo "Login berhasil!";
} else {
    echo "Login gagal: " . $response->message;
}

$userData = $sso->getUserData();

echo "Nama: " . $userData->nama;
echo "Email: " . $userData->email;

Route::get('/test-sso', function() {
    $sso = new \Alfaqosry\SsoClientup\SsoClient();
    $result = $sso->login('testuser', 'testpass');

    dd($result);
});
bash
php artisan vendor:publish --provider="Alfaqosry\SsoClientup\SsoClientupServiceProvider"