Sdkkey cannot be empty

When I upgraded zoom web SDK to 2.12.0, started getting error while starting the meeting “SDK key cannot be empty”

Can anyone help?

Hi @ajinkya.kulkarni
Thanks for reaching out to us.
Can you please make sure that you are adding your SDK key correctly to your code?

Here is how we generate the signature (PHP)-

$time = time() * 1000 - 30000; //time in milliseconds (or close enough)
		$data = base64_encode($api_key . $meeting_number . $time . $role);
		$hash = hash_hmac('sha256', $data, $api_secret, true);
		$_sig = $api_key . "." . $meeting_number . "." . $time . "." . $role . "." . base64_encode($hash);
		//return signature, url safe base64 encoded
		$signature = rtrim(strtr(base64_encode($_sig), '+/', '-_'), '=');```

And here is how we Join the meeting - 

$.post(
apachehost + “API/authenticate/generate_signature”,
{
action: “sign”,
meetingNumber: meetingNumber,
role: role, //1 for admin
},
function (data) {
var response_string = JSON.parse(data);
console.log(api_key, userName, response_string);
client.join({
sdkKey: api_key,
signature: response_string.data.signature,
meetingNumber: meetingNumber,
password: meetingPwd,
userName: userName,
}).then(function (response) {
$(“#join_publish_button”).hide();
$(“#save_recording_btn”).show();
loadingSpinnerModal(“loader”, “Connecting … Please wait …”, false);
})
.catch(function (error) {
loadingSpinnerModal(“loader”, “Connecting … Please wait …”, false);
console.log(“ZoomError”, error);
showError(“Some error connecting the live lecture … Please try again”);
});;
}
);

Now it says Signature invalid! Join failed!

SDK 2.12.0 does’t support JWT app anymore - you have to migrate to Meeting SDK app with the new types of signatures

https://developers.zoom.us/docs/internal-apps/jwt-app-migration/#jwt-app-type-to-sdk-app-type-migration

important: if you create a new Meeting SDK app

id

1 Like

I am calling Zoom APIs and using access token with JWT. Do I have to migrate that as well?

you need Server-to-Server Oauth app for API calls

here another info - it seems you can use meeting SDK credentials for API calls

I am getting Signature expired error when trying to create a signature with Server to Server Auth credentials -
This is the code


$time     = round( ( time() * 1000 - 30000 ) / 1000 );
		$exp     = $time + 86400;

		//$exp = ($time + 21600000); //6 hour expiry

		$time = $time * 1000;
		$exp = $exp * 1000;
$headers = array(
			'alg' => 'HS256', //alg is required. see *Algorithms* section for supported algorithms
			'typ' => 'JWT'
		);
		
		// anything that json serializable
		$payload = array(
			'sdkKey' => $api_key,
			'appKey' => $api_key,
			'mn' => $meeting_number,
			'role' => $role,
			'iat' => $time,
			'exp' => $exp,
			'tokenExp' => $exp
		);
		
		//$key = 'some-secret-for-hmac';
		
		$jws = new \Gamegos\JWS\JWS();
		$signature = $jws->encode($headers, $payload, $api_key);

do you have a sample of the created JWT token?

you are using millisconds (depr. JWT app) - you have to use seconds (Meeting SDK app)

Now this this code, I’m getting Signature is invalid (Using firebase JWT)

$iat = time();
    	$exp = $iat + 60 * 60 * 2;
    	// $token_payload = [
    
        // 'sdkKey' => $api_key,
        // 'mn' => $meeting_number,
        // 'role' => $role,
        // 'iat' => $iat,
        // 'exp' => $exp,
        // 'tokenExp' => $exp
    	// ];

		$token_payload = array(
			'sdkKey' => $api_key,
			'appKey' => $api_key,
			'mn' => $meeting_number,
			'role' => $role,
			'iat' => $iat,
			'exp' => $exp,
			'tokenExp' => $exp
		);

    	$signature = JWT::encode($token_payload, $api_secret, 'HS256');

@ajinkya.kulkarni .

Thank you for posting in the Zoom Developer Forum. Please take a look at this helpful blog post for guidance on troubleshooting SDK JWT behavior.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.