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