PHP code example of hoabinh / platform-sdk-core
1. Go to this page and download the library: Download hoabinh/platform-sdk-core 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/ */
hoabinh / platform-sdk-core example snippets
use HoaBinh\PlatformSdk\Core\Client\HbSsoClient;
use HoaBinh\PlatformSdk\Core\Config\SsoConfig;
$config = SsoConfig::fromArray([
'issuer' => 'https://auth.hoabinh-group.com',
'client_id' => '...',
'client_secret' => '...',
'redirect_uri' => 'https://app.test/auth/callback',
]);
$sso = new HbSsoClient($config);
$state = $sso->generateState();
$verifier = $sso->generateCodeVerifier();
$url = $sso->getAuthorizeUrl($state, $verifier);