Error creating signature in Prod

Hi,

I’m having trouble implementing zoomMeeting in production. I created a new app in the Marketplace SDK which provides me with a Client ID and the Key Secret. Both replace them with the sdkKey and ApiKey. The fact is that locally and on my test server it works perfectly and I can join the meeting. But once I have it on my production server it gives me an error that the signature appears.

I’m using version 2.11.5 currently, I’ve tried all the others and it also works less in production.

I have checked the server time zone and both test and production are in UTC. Could you help me identify what is happening?

Thank you

1 Like

double check if the server time is really correct → synchronise with a time server

you should check your code for creating the signature

  • “iat” should be 30 seconds in the past
1 Like

Yes, the time zone is correct. I have the same code to generate the signature, both in prod and test.

I attach the code that generates the signature:

$dataMeetConfig = $dataJson[‘meetConfig’];
$meeting_number = $dataMeetConfig[‘meetingNumber’];
$role = $dataMeetConfig[‘role’];
$api_key = $dataMeetConfig[‘apiKey’];
$api_secret = ‘**************************’;

    //Set the timezone to UTC
    date_default_timezone_set("UTC");

    $iat = round(time() / 1000) - 30;
    $exp= $iat + 60 * 60 * 2;

    $key = $api_key;
    $secret = $api_secret;
    $token = array(
        "sdkKey" => $key,
        "mn" => $meeting_number,
        "role" => $role,
        "iat" => time(),
        "exp" => time() + 3600, //60 seconds as suggested
        "tokenExp" => time() + 3600,
    );
    $encode = JWT::encode($token, $secret, 'HS256');

Previously I kept this code that also worked in test and not in prod:

$key = $api_key;
$secret = $api_secret;
$token = array(
“sdkKey” => $key,
“mn” => $meeting_number,
“role” => $role,
“iat” => $iat,
“exp” => time() + 3600, //60 seconds as suggested
“tokenExp” => time() + 3600,
);
$encode = JWT::encode($token, $secret, ‘HS256’);

Solved, the problem was the 30 seconds in the past. Thank you so much!

1 Like