-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrefresh-token.php
44 lines (34 loc) · 1.07 KB
/
refresh-token.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
use setasign\SetaPDF\Signer\Module\SAFE\Client;
use Ramsey\Uuid\Uuid;
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
require_once '../vendor/autoload.php';
if (!file_exists('settings.php')) {
echo 'The settings.php file is missing. See settings.php.dist for an example.';
die();
}
$settings = require 'settings.php';
$apiUri = $settings['apiUri'];
$credentialId = $settings['credentialId'];
$processId = Uuid::uuid4()->toString();
$clientName = $settings['clientName'];
$httpClient = new GuzzleHttp\Client();
$requestFactory = new Http\Factory\Guzzle\RequestFactory();
$streamFactory = new Http\Factory\Guzzle\StreamFactory();
$client = new Client(
$apiUri,
$settings['basicAuthUsername'],
$settings['basicAuthPassword'],
$httpClient,
$requestFactory,
$streamFactory
);
// uncomment this to create a new accessToken and update your settings.php with it
//var_dump($client->signatureAccountUpdateToken(
// $settings['refreshToken'],
// $credentialId,
// $processId,
// $clientName
//));