within PHP
Expiration of the token issued stops playing the signed video at 1 hour
how to fix so it works for 4 hours for each user who gets a token
my PHP code:
$curl = curl_init();
$expiration_time = time() + 4 * 3600; // 4 hours from now
curl_setopt_array($curl, array(
CURLOPT_URL => “https://api.cloudflare.com/client/v4/accounts/xxxxxxxxxxxxxxxxxxxxxxxx/stream/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/token”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => ‘’,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => ‘POST’,
CURLOPT_HTTPHEADER => array(
“Authorization: Bearer REDACTED”,
“exp: $expiration_time”,
),
));