friendship ended with social-app. php is my new best friend

or do i use this

Changed files
+2 -14
+2 -14
index.php
···
$provider->setPds($pds);
$token_builder = Builder::new(new JoseEncoder(), ChainedFormatter::default());
$algorithm = new Sha256();
-
$signing_key = InMemory::plainText(CLIENT_SECRET);
$now = new DateTimeImmutable();
$token = $token_builder
->withHeader('alg', 'ES256')
···
->permittedFor('did:web:'.str_replace("/", "", str_replace("https://", "", $pds)))
->issuedAt($now)
->getToken($algorithm, $signing_key);
-
print_r($token->toString());
-
/*$jwt_header = base64_encode(json_encode([
-
'alg' => 'ES256',
-
'typ' => 'JWT'
-
]));
-
$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()
···
$provider->setPds($pds);
$token_builder = Builder::new(new JoseEncoder(), ChainedFormatter::default());
$algorithm = new Sha256();
+
$signing_key = InMemory::plainText(CERT);
$now = new DateTimeImmutable();
$token = $token_builder
->withHeader('alg', 'ES256')
···
->permittedFor('did:web:'.str_replace("/", "", str_replace("https://", "", $pds)))
->issuedAt($now)
->getToken($algorithm, $signing_key);
+
print_r($token->toString());
$client->setDefaultOption('headers', [
'User-Agent' => USER_AGENT_STR,
'Authorization' => 'Bearer: '.$token->toString()