···
$token_builder = Builder::new(new JoseEncoder(), ChainedFormatter::default());
$algorithm = new Sha256();
206
-
$signing_key = InMemory::plainText(CLIENT_SECRET);
206
+
$signing_key = InMemory::plainText(CERT);
$now = new DateTimeImmutable();
->withHeader('alg', 'ES256')
···
->permittedFor('did:web:'.str_replace("/", "", str_replace("https://", "", $pds)))
->getToken($algorithm, $signing_key);
216
-
print_r($token->toString());
216
+
print_r($token->toString());
218
-
/*$jwt_header = base64_encode(json_encode([
222
-
$jwt_body = base64_encode(json_encode([
223
-
'iss' => $userInfo->did,
224
-
'sub' => 'https://'.SITE_DOMAIN.CLIENT_ID,
225
-
'aud' => 'did:web:'.str_replace("/", str_replace("https://", $pds)),
226
-
'jti' => hash('sha512', bin2hex(random_bytes(256 / 2))),
227
-
'iat' => strtotime('now')
229
-
$jwt = $jwt_header.$jwt_body.base64_encode(CERT);*/
$client->setDefaultOption('headers', [
'User-Agent' => USER_AGENT_STR,
'Authorization' => 'Bearer: '.$token->toString()