# Sdkkey cannot be empty

**URL:** <https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156>\
**Category:** Web\
**Tags:** sdk\
**Created:** [May 10, 2023, 11:12am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156 "2023-05-10T11:12:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajinkya.kulkarni](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ajinkya.kulkarni](https://devforum.zoom.us/u/ajinkya.kulkarni)\
**Post date:** [May 10, 2023, 11:12am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/1 "2023-05-10T11:12:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [May 10, 2023, 8:20pm UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/2 "2023-05-10T20:20:26Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ajinkya.kulkarni](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ajinkya.kulkarni](https://devforum.zoom.us/u/ajinkya.kulkarni)\
**Post date:** [May 11, 2023, 4:56am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/3 "2023-05-11T04:56:59Z")

</div>

Here is how we generate the signature (PHP)-

````auto
$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”);  
});;  
}  
);

```auto
Now it says Signature invalid! Join failed!
```

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [May 11, 2023, 5:19am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/4 "2023-05-11T05:19:35Z")

</div>

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](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](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/2/f22699916674842c6e256a3f17d0f51dfd29b21e.png)

---

<div class="post-metadata">

**Author:** ![ajinkya.kulkarni](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ajinkya.kulkarni](https://devforum.zoom.us/u/ajinkya.kulkarni)\
**Post date:** [May 11, 2023, 10:31am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/5 "2023-05-11T10:31:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [May 11, 2023, 3:47pm UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/6 "2023-05-11T15:47:57Z")

</div>

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

> [@cURL call to get users with JWT token - not working](https://devforum.zoom.us/t/curl-call-to-get-users-with-jwt-token-not-working/88125/2):
>
> Hi @captainben99 Thanks for reaching out to the Zoom Developer Forum and welcome to our community! I am happy to help here! If my understanding is correct after reading your post, it looks like you are trying to generate a JWT token using the meeting SDK app credentials and that’s the reason why you are getting that error. So, question 1: WIth the API calls, is the token used supposed to be the JWT token? I am NOT using OAuth at all right now, although I did get my callback to work save the…

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [May 11, 2023, 3:54pm UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/7 "2023-05-11T15:54:51Z")

</div>

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

> [@Upgrading SDK version and switching from JWT app to Server-To-Server OAuth](https://devforum.zoom.us/t/upgrading-sdk-version-and-switching-from-jwt-app-to-server-to-server-oauth/87758/6):
>
> @vishwajeetbhosale Question: Is it possible to keep the same flow as it was with JWT App type? Answer: Could you elaborate on what is the “flow” you want to keep? Question: Can we use same SDK Key & Secrete for meeting & API OR SDK is only for Web Meeting & OAuth for ZOOM Rest API (I’m using Get user, Get Meeting, Create Meeting, Create User etc.) Answer: If you are using a recently created Meeting SDK App Type, you will have Client ID and Client Secret as your credentials. This can be used …

---

<div class="post-metadata">

**Author:** ![ajinkya.kulkarni](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ajinkya.kulkarni](https://devforum.zoom.us/u/ajinkya.kulkarni)\
**Post date:** [May 13, 2023, 1:18pm UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/8 "2023-05-13T13:18:32Z")

</div>

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

```auto

$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);

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [May 15, 2023, 1:19am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/9 "2023-05-15T01:19:31Z")

</div>

do you have a sample of the created JWT token?

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [May 15, 2023, 5:27am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/10 "2023-05-15T05:27:58Z")

</div>

> [@ajinkya.kulkarni](#):
>
> ```auto
> $time = round( ( time() * 1000 - 30000 ) / 1000 );
> $exp = $time + 86400;
> 
> $time = $time * 1000;
> $exp = $exp * 1000;
> 
> ```

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

> [@How do I generate a valid SDK signature from PHP?](https://devforum.zoom.us/t/how-do-i-generate-a-valid-sdk-signature-from-php/70691/5):
>
> @SVIF Here is example SDK Signature in PHP: \<?php /\*\* \* Below are the fields required for the JWT payload \* sdkKey: Your SDK Key. Required for Web, optional for Native. \* sdkSecret Required, your SDK API Secret \* mn: The Zoom Meeting or Webinar Number. Required for Web, optional for Native. \* role: The user role. Required for Web, optional for Native. Values: 0 to specify participant, 1 to specify host. \* iat: The current timestamp in epoch format. Required. \* exp: JWT expiration date…

---

<div class="post-metadata">

**Author:** ![ajinkya.kulkarni](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ajinkya.kulkarni](https://devforum.zoom.us/u/ajinkya.kulkarni)\
**Post date:** [May 16, 2023, 6:02am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/11 "2023-05-16T06:02:10Z")

</div>

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

```auto
$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');

```

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [June 1, 2023, 3:52pm UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/12 "2023-06-01T15:52:09Z")

</div>

@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.

> **[Troubleshooting Zoom Meeting SDK Signature Validation](https://dev.to/zoom/troubleshooting-zoom-meeting-sdk-signature-validation-1hln)**
>
> In this guide, we’ll cover common issues you may run into when generating a signature for the Zoom...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 2, 2023, 1:52am UTC](https://devforum.zoom.us/t/sdkkey-cannot-be-empty/88156/13 "2023-07-02T01:52:16Z")

</div>

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