# Migrating JWT to Server to Server Oauth from 2.6 to 2.7

**URL:** <https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651>\
**Category:** Web\
**Created:** [March 14, 2023, 2:40am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651 "2023-03-14T02:40:57Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [March 14, 2023, 2:40am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/1 "2023-03-14T02:40:57Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**  
\<link type=“text/css” rel=“stylesheet” href=“[https://source.zoom.us/2.7.0/css/bootstrap.css](https://source.zoom.us/2.7.0/css/bootstrap.css)” /\>  
\<link type=“text/css” rel=“stylesheet” href=“[https://source.zoom.us/2.7.0/css/react-select.css](https://source.zoom.us/2.7.0/css/react-select.css)” /\>  
\<script src=“[https://source.zoom.us/2.7.0/lib/vendor/react.min.js](https://source.zoom.us/2.7.0/lib/vendor/react.min.js)”\>  
\<script src=“[https://source.zoom.us/2.7.0/lib/vendor/react-dom.min.js](https://source.zoom.us/2.7.0/lib/vendor/react-dom.min.js)”\>  
\<script src=“[https://source.zoom.us/2.7.0/lib/vendor/redux.min.js](https://source.zoom.us/2.7.0/lib/vendor/redux.min.js)”\>  
\<script src=“[https://source.zoom.us/2.7.0/lib/vendor/redux-thunk.min.js](https://source.zoom.us/2.7.0/lib/vendor/redux-thunk.min.js)”\>  
\<script src=“[https://source.zoom.us/2.7.0/lib/vendor/lodash.min.js](https://source.zoom.us/2.7.0/lib/vendor/lodash.min.js)”\>  
\<script src=“[https://source.zoom.us/zoom-meeting-2.7.0.min.js](https://source.zoom.us/zoom-meeting-2.7.0.min.js)”\>

**Description**  
When I tried to migrate the zoom websdk from 2.6.0 to 2.7.0, I have updated the meeting.html and meeting.js (from 2.6.0 to 2.6.7) and changed apiKey to sdkKey.  
I am using iFrame to embed the meeting.html, the iFrame src is also updated to pass the sdkKey, instead of apiKey.  
Of course, I also updated the JWT api key and secret to Server-to-Server OAuth.  
But I still use the old function to generate the signature, not sure if this is the reason causing the error.

**Error?**  
The video screen shows:  
Joining meeting timeout  
invalid parameter

**How To Reproduce**  
_Steps to reproduce the behavior:_  
Here is the generated link for iFrame  
vendor/zoom/CDN/meeting.html?name=xxxxxxxxx&mn=/8869354886&email=xxxxxxxx=&pwd=322185&role=0&lang=en-US&signature=aEwybTBiTDFUMDJzX2xvSlFiZ0JKZy44ODY5MzU0ODg2NS4xNjc4NzYxNTY0MDAwLjAuMjVZZ2YvcXh5dEw0amtOeDRDbE5EOGhKRkk3bzBjanh5NjAwMDIxejhMMD0&china=0&sdkKey=hL2m0bL1T02s\_loJQbgBJg

---

<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:** [March 21, 2023, 3:34pm UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/3 "2023-03-21T15:34:27Z")

</div>

@nelson.chow.

Thank you for posting in the Zoom Developer – I am happy to help. See response below:

> [@nelson.chow](#):
>
> name=xxxxxxxxx&mn\*\*=/8869354886\*\*&email=xxxxxxxx=&pwd=322185&role=0&lang=en-US&signature=aEwybTBiTDFUMDJzX2xvSlFiZ0JKZy44ODY5MzU0ODg2NS4xNjc4NzYxNTY0MDAwLjAuMjVZZ2YvcXh5dEw0amtOeDRDbE5EOGhKRkk3bzBjanh5NjAwMDIxejhMMD0&china=0&sdkKey=hL2m0bL1T02s\_loJQbgBJg

It looks like you the mn parameter has `/` appended to the meeting number. Can you removed that `/` and let us know if the behavior persists ?

---

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [March 22, 2023, 2:48am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/4 "2023-03-22T02:48:10Z")

</div>

Actually, there is no “/” between “mn=” and the meeting ID in the source code, not sure why it shown the “/”. Anyway, I tried again, still same error

/vendor/zoom/CDN/meeting.html?name=Ui0yMTE2MTM2&mn=87092947942&email=Ui0yMTE2MTM2QGhpZGRlbi5tcHBsaWNhdGlvbi5jb20=&pwd=553455&role=0&lang=en-US&signature=aEwybTBiTDFUMDJzX2xvSlFiZ0JKZy44NzA5Mjk0Nzk0Mi4xNjc5NDUzMjE3MDAwLjAuWkdzSmdJM2JrUEFUQW9zY2J6Qnc3ZzNRSVlFLy8vbWZlTDY3eDZ6b2JHdz0&china=0&sdkKey=hL2m0bL1T02s\_loJQbgBJg

---

<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:** [March 22, 2023, 9:46am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/5 "2023-03-22T09:46:23Z")

</div>

Thanks for your response, @nelson.chow! Are you seeing the same issues with our Demo app? Or just with the migrated Zoom Web SDK version of your app? If the former, could you provide the steps to reproduce this with our demo app?

---

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [March 22, 2023, 10:18am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/6 "2023-03-22T10:18:56Z")

</div>

I have not checked your demo app. I just upgrade on my own codes at this stage. Do you mean I need to use your demo app to rewrite all the things?

Can I modify my existing codes in order to upgrade?

---

<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:** [March 22, 2023, 10:27am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/7 "2023-03-22T10:27:05Z")

</div>

@nelson.chow,

You can modify your existing codes in order to upgrade but you may encounter nuances. To help isolate the behavior you are seeing, could you please test with the sample App and let us know if the behavior continues?

---

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [March 23, 2023, 2:57am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/8 "2023-03-23T02:57:50Z")

</div>

Sorry, could you tell me where could I find the sample app?

---

<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:** [March 23, 2023, 6:46am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/9 "2023-03-23T06:46:32Z")

</div>

@nelson.chow,

You can find all of our sample Apps on Github: [Zoom · GitHub](https://github.com/zoom)

---

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [March 23, 2023, 3:07pm UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/10 "2023-03-23T15:07:55Z")

</div>

I tried the sample, (meetingsdk-web-sample-master.zip). I have updated the index.js with my client ID and secret (Server-To-Server OAuth), then I create the a zoom meeting to try. After entering the meeting ID and password and click join button, it prompts error invalid signature.

This is the generated link for your reference:  
[http://tools/zoom/CDN/meeting.html?name=Q0ROMi4xMC4xV2luMTAjY2hyb21lLzExMS4wLjAuMA%3D%3D&mn=89133586961&email=&pwd=245707&role=0&lang=en-US&signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJoTDJtMGJMMVQwMnNfbG9KUWJnQkpnIiwiaWF0IjoxNjc5NTgzNTU4LCJleHAiOjE2Nzk1OTA3NTgsIm1uIjo4OTEzMzU4Njk2MSwicm9sZSI6MH0.t3gh12H4TW10CJWUJRhb1ypaZ-nwoeUcSNLPZme4T\_M&china=0&sdkKey=hL2m0bL1T02s\_loJQbgBJg](http://tools/zoom/CDN/meeting.html?name=Q0ROMi4xMC4xV2luMTAjY2hyb21lLzExMS4wLjAuMA%3D%3D&mn=89133586961&email=&pwd=245707&role=0&lang=en-US&signature=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJoTDJtMGJMMVQwMnNfbG9KUWJnQkpnIiwiaWF0IjoxNjc5NTgzNTU4LCJleHAiOjE2Nzk1OTA3NTgsIm1uIjo4OTEzMzU4Njk2MSwicm9sZSI6MH0.t3gh12H4TW10CJWUJRhb1ypaZ-nwoeUcSNLPZme4T_M&china=0&sdkKey=hL2m0bL1T02s_loJQbgBJg)

---

<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:** [March 25, 2023, 1:19am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/11 "2023-03-25T01:19:08Z")

</div>

@nelson.chow,

Instead of entering your client ID and secret (Server-To-Server OAuth), you want to enter the Meeting SDK marketplace App client ID and secret.

# Create a Meeting SDK App

[https://marketplace.zoom.us/docs/guides/build/sdk-app/](https://marketplace.zoom.us/docs/guides/build/sdk-app/)

# Authorization (Meeting SDK )

[https://marketplace.zoom.us/docs/sdk/native-sdks/auth/](https://marketplace.zoom.us/docs/sdk/native-sdks/auth/)

# Note :

 ![Screenshot 2023-03-24 at 9.18.21 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/5/6/56e502ea186039a8ddf61eb5ccd6b77f5eeadb4f.png)

---

<div class="post-metadata">

**Author:** ![nelson.chow](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/nelson.chow/32/34506_2.png) [@nelson.chow](https://devforum.zoom.us/u/nelson.chow)\
**Post date:** [April 8, 2023, 3:49am UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/12 "2023-04-08T03:49:04Z")

</div>

Sorry for the late reply, after changing to use “Meeting SDK” - SDK Key & SDK Secret, we still get “signature is invalid”

Do we need to change the function of generate the signature?

```auto
function generate_signature ( $api_key, $api_secret, $meeting_number, $role){
	date_default_timezone_set("UTC");
	$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
	return rtrim(strtr(base64_encode($_sig), '+/', '-_'), '=');
}

```

---

<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:** [April 11, 2023, 1:50pm UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/13 "2023-04-11T13:50:54Z")

</div>

Thank you for the details. To confirm, are you generating the signature with PHP function? If so, here is a helpful developer forum post on generating the signature with PHP:

> [@Failed to join meeting when using websdk](https://devforum.zoom.us/t/failed-to-join-meeting-when-using-websdk/77602):
>
> I have created a meeting using api and jwt app API key and secret key. Then I installed @zoomus/websdk the n when I click the join meeting in web a signature is generated in backend with PHP and then join the meeting but it says type: ‘JOIN\_MEETING\_FAILED’, reason: ‘Fail to join the meeting.’, errorCode: 200 code to generate signature in backend: public function generate\_signature($meeting\_number, $role) { $api\_key = config('zoom.zoom\_sdk\_key'); $api\_secret = config('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:** [May 11, 2023, 11:51pm UTC](https://devforum.zoom.us/t/migrating-jwt-to-server-to-server-oauth-from-2-6-to-2-7/84651/14 "2023-05-11T23:51:33Z")

</div>

Closed on May 11, 2023, 11:51pm UTC

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