Unable to join meeting. signature invalid

Dear Team,

I am trying to join a meeting with the javascript example. I have generated the signature using JWT as suggested, but am getting the signature invalid issue.
Please find below the tracking id.
X-Zm-Trackingid: v=2.0;clid=us05;rid=WEB_1e084a21e86e163306eedbf14fbf78f1

Thanks

Verify that you are using the correct API Key and Secret.
Ensure your JWT payload includes the correct fields: meetingNumber, role, iat, exp, appKey, tokenExp.
Make sure the iat (issued at) and exp (expiration) times are correctly set and synchronized with the server’s time.

Hi Xavi,

Thank you for the response. Following is my code to generate the signature. I have verified all these are correct and also checked the signature

use \Firebase\JWT\JWT;

$key = [Client Secret]
$iat = time() - 4000; //Just to make sure this is in the past
$exptime = $iat + 17200 ;

$payload = [
‘sdkKey’ => ‘[Client ID]’,
‘appKey’ => ‘[Client ID]’,
‘mn’ => ‘[meeting number]’,
‘role’ => 0,
‘iat’ => $iat,
‘exp’ => $exptime,
‘tokenExp’ => $exptime,
];
$signature = JWT::encode($payload, $key, ‘HS256’);