Javascript Web SDK The signature has expired

Hi There,

My code for join the meeting using Web SDK is working on Linux server but in my local mac, it is not working. I am getting this error message.

localJsonpCallback({“status”:false,“errorCode”:200,“errorMessage”:“The signature has expired.”,“result”:null});

It was working before but after updating to macOS catalina. it started throwing this error. there are other post related to this error but none of the solution help me.

Thanks,
Ritesh

Hey @danish,

Can you please share the code you are using to generate the signature?

Also be aware of timezone differences between creation of the signature on your server vs. mac.

Thanks,
Tommy

Hey tommy,

Thanks for quick response. Here is the code for generating signature.

/**
 * Generate SDK signature for joining meeting
 *
 * @param int $meetingNumber
 * @param int $role
 * @return string
 */
public static function  generateZoomSDKSignature($meetingNumber, $role)
{
    $apiKey = config('project.zoomApiKey');

    $apiSecret = config('project.zoomApiSecret');

    $time = time() * 1000; //time in milliseconds

    $data = base64_encode($apiKey . $meetingNumber . $time . $role);

    $hash = hash_hmac('sha256', $data, $apiSecret, true);

    $_sig = $apiKey . "." . $meetingNumber . "." . $time . "." . $role . "." . base64_encode($hash);

    return rtrim(strtr(base64_encode($_sig), '+/', '-_'), '=');
}

Yes it is different timezone between server and local mac. I have tried to sent time from local so that the signature time should be same as local mac. But still i am getting the same error.

Hey @danish,

Thanks for sending this. To confirm, you are using the API Key and Secret from a JWT app type correct?

Possible duplicates with solutions:

Let me know if those help.

Thanks,
Tommy

Hi Tommy,

I just subtract time by just 1 min and it start working. Anyway thanks for response.

Thanks,
Ritesh

1 Like

Hi @danish,

Glad that you got it working. Let us know if you need anything else!

Thanks

1 Like