1. Go to this page and download the library: Download dencel/eparaksts 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/ */
dencel / eparaksts example snippets
use Dencel\Eparaksts\Eparaksts;
$e = new Eparaksts('client-id', 'client-secret');
// 1. Redirect the user
$url = $e->authorize(Eparaksts::SCOPE_IDENTIFICATION, 'random-state', 'https://app.test/callback');
header('Location: ' . $url);
// 2. Handle the callback
$token = $e->requestToken(Eparaksts::GRANT_AUTHORIZATION_CODE, [
'code' => $_GET['code'],
'redirect_uri' => 'https://app.test/callback',
]);
// 3. Fetch the authenticated user
$user = $e->me(Eparaksts::SCOPE_IDENTIFICATION);
use Dencel\Eparaksts\SignAPI\v1\SignAPI;
$api = new SignAPI('client-id', 'client-secret');
$api->freshToken(); // fetches and stores a client_credentials token