# Signature invalid in Meeting SDK app type in NextJs

**URL:** <https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280>\
**Category:** Authentication\
**Created:** [April 7, 2023, 12:37pm UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280 "2023-04-07T12:37:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 7, 2023, 12:37pm UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/1 "2023-04-07T12:37:57Z")

</div>

I am trying to upgrade to Meeting SDK app type and have followed the docs and sample app as suggested, however I am getting invalid signature. I have cross-checked everything but not able to figure whats the issue. Here is the code i am using in backend to generate signature

> exports.zoomSignature = async (req, res) =\> {
> 
> try {
> 
> ```
> const iat = Math.round(new Date().getTime() / 1000) - 30;
> 
> const exp = iat + 60 * 60 * 2
> 
> const oHeader = { alg: 'HS256', typ: 'JWT' }
> 
> const oPayload = {
> 
> sdkKey: process.env.ZOOM_CLIENT_ID,
> 
> mn: req.body.meetingNumber,
> 
> role: req.body.role,
> 
> iat: iat,
> 
> exp: exp,
> 
> appKey:process.env.ZOOM_CLIENT_ID,
> 
> tokenExp: iat + 60 * 60 * 2
> 
> }
> 
> const sHeader = JSON.stringify(oHeader)
> 
> const sPayload = JSON.stringify(oPayload)
> 
> const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, process.env.ZOOM_CLIENT_SECRET)
> 
> res.json({
> 
> signature: signature
> 
> })
> 
> ```
> 
> } catch (error) {
> 
> ```
> console.log(error);
> 
> return res.status(500).json({
> 
> message: error.message
> 
> })
> 
> ```
> 
> }
> 
> }

Here is my frontend code:

```auto

  const meetingConfig = {
    sdkKey: "c2t1_GfbR3qrX66FyGsyYQ",
    meetingNumber: meetingNumber,
    userName: name? name : "learner",
    passWord: password,
    leaveUrl,
    role: 0,
    tk: '',
  };
  // console.log(meetingConfig)
  const signatureCall = await apiReq(`${process.env.BASE_URL}/api/session/zoomSignature`, "POST", {
    meetingNumber: meetingNumber,
    role: 0
  });
  const signature = signatureCall.data.signature

  console.log(signature, "SIG")
  ZoomMtg.init({
    leaveUrl: meetingConfig.leaveUrl,
    isSupportAV: true,
    success: () => {
      console.log("SIGNATURE SUCCESS")
      console.log({
        signature: signature,
        meetingNumber: meetingConfig.meetingNumber,
        userName: meetingConfig.userName,
        sdkKey: meetingConfig.sdkKey,
        userEmail: '',
        passWord: meetingConfig.passWord,
      });
      ZoomMtg.join({
        signature: signature,
        meetingNumber: meetingConfig.meetingNumber,
        userName: meetingConfig.userName,
        sdkKey: meetingConfig.sdkKey,
        userEmail: '',
        passWord: meetingConfig.passWord,
        success: (success) => {
          console.log(success);
        },
        error: (error) => {
          console.log(error);
        },
      });
    },
    error: (error) => {
      console.log("SIGNATURE ERROR")
      console.log(error);
    },
  });
}

```

Here is one of the example of an attempt to join meeting from front end with error

Generated signature: {REDACTED}

meetingNumber: ‘81198873582’  
sdkKey: ‘c2t1\_GfbR3qrX66FyGsyYQ’

Error i get is following  
errorCode: 3712  
errorMessage: “Signature is invalid.”  
method: “join”  
result: “Invalid signature.”  
status: false

Let me know if any further details required, thanks

---

<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:** [April 7, 2023, 10:59pm UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/2 "2023-04-07T22:59:32Z")

</div>

your signature seems ok - tested [here](https://jwt.io/)

is your meeting sdk app created before 11. Feb 2023 ?

if yes, you have to use the SDK Credentials (SDK Key, Secret), not the OAuth credentials (Client ID, Secret)

![id](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/2/f22699916674842c6e256a3f17d0f51dfd29b21e.png)

if this is not the problem, you should start with the example on github (CDN version)

> **[meetingsdk-web-sample/CDN at master · zoom/meetingsdk-web-sample](https://github.com/zoom/meetingsdk-web-sample/tree/master/CDN)**
>
> master/CDN

the **CDN version** is ready to use with a few simple steps

```auto
CDN/js/index.js:20 var CLIENT_ID = "YOUR_CLIENT_ID_OR_SDK_KEY";;
CDN/js/index.js:26 var CLIENT_SECRET = "YOUR_CLIENT_SECRET_OR_SDK_SECRET;
CDN/js/index.js:112 ... "/meeting.html?" // replace '/' with './'

CDN/js/meeting.js:31 leaveUrl: "/index.html", // replace '/' with './'

```

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 8, 2023, 6:52am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/3 "2023-04-08T06:52:03Z")

</div>

Yes it created after 11 Feb, and we are trying to upgrade to Server-to-Server OAuth. I am sure where do i need to put cdn files in my Next.Js. Does it go on \_document.js? Is there anyway to fix my current implementation ? I took reference from this sample app [GitHub - zoom/meetingsdk-react-sample: Use the Zoom Meeting SDK in React](https://github.com/zoom/meetingsdk-react-sample)

---

<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:** [April 8, 2023, 7:41am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/4 "2023-04-08T07:41:56Z")

</div>

first **test** the simple CDN example\* - 5 minutes work and you can see if the created Meeting SDK app is working correct

'\* it works perfect with localhost without any special server configuration

---

<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:** [April 8, 2023, 7:57am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/5 "2023-04-08T07:57:27Z")

</div>

you have really created a “ **Meeting SDK App** ” ?

> [@How to generate signature for OAuth app type](https://devforum.zoom.us/t/how-to-generate-signature-for-oauth-app-type/85908/4):
>
> @pbudzyn, Yes, to authorize the SDK you need to create a Meeting SDK Marketplace app.

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 8, 2023, 9:15am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/7 "2023-04-08T09:15:20Z")

</div>

> [@j.schoenemeyer](#):
>
> `./`

After running the cdn example as you suggested, it seems i am still getting the same error

## Joining meeting timeout.

Signature is invalid.

---

<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:** [April 8, 2023, 9:55am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/8 "2023-04-08T09:55:08Z")

</div>

strange - I have just tested the CDN example with my (old) Meeting SDK app and my “test meeting” → no problems

next ideas

- is there a “retry” button on your error message ? if yes click it multiple times

- is the time correctly synchronized on your computer?

- create a meeting with settings (like my test meeting) and connect as **attendee**

 ![meeting](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/1/11cbbb760c3c1f59829936e1ea192880c1895195.png)

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 8, 2023, 10:03am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/9 "2023-04-08T10:03:29Z")

</div>

It seems like my colleague miscommunicated, it seems he has created only o-auth app and not meeting sdk. My apologies, we were using JWT app and are now trying to upgrade to server to server o-auth as JWT app is being depricated. I assume creating Meeting SDK app is necessary for this to work?

---

<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:** [April 8, 2023, 10:06am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/10 "2023-04-08T10:06:23Z")

</div>

good news - the error is found 🙂

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 8, 2023, 10:16am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/11 "2023-04-08T10:16:45Z")

</div>

Yes i will update here after creating it and if it works afterwards 🙂

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 10, 2023, 10:22am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/12 "2023-04-10T10:22:53Z")

</div>

Update: I created SDK app and replaced its sdk key and secret to frontend and backend where i am generating signature. Unfortunately i am still getting invalid signature. Tried both CDN and React integration. Here is the new signature that was generated:

[REDACTED]

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 10, 2023, 12:37pm UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/13 "2023-04-10T12:37:46Z")

</div>

Also for testing i created a new zoom account and created new sdk app on it and used that credentials on CDN, still invalid signature. Strange

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 11, 2023, 12:02am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/14 "2023-04-11T00:02:04Z")

</div>

Hey @varcityzoom1 ,

Can you try using this sample app to generate the signature?

Make sure to pass in your **Meeting SDK app type** Client ID and Client Secret:

> **[GitHub - zoom/meetingsdk-auth-endpoint-sample: Generate a Meeting SDK JWT to...](https://github.com/zoom/meetingsdk-auth-endpoint-sample)**
>
> Generate a Meeting SDK JWT to join Zoom meetings and webinars with the Meeting SDK. - GitHub - zoom/meetingsdk-auth-endpoint-sample: Generate a Meeting SDK JWT to join Zoom meetings and webinars wi...

If that still does not work, please submit a devsupport ticket and ask the support team to check if the Meeting SDK is enabled for your account.

Best,  
Tommy

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 11, 2023, 5:03am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/15 "2023-04-11T05:03:16Z")

</div>

I used the sample app to generate following singature:

[REDACTED]

on decoding it has the following payload:  
{  
“sdkKey”: “lAzXXLSJQyKbYI1xZwqQOw”,  
“mn”: “82295245018”,  
“role”: 0,  
“iat”: 1681189069,  
“exp”: 1681196269,  
“appKey”: “lAzXXLSJQyKbYI1xZwqQOw”,  
“tokenExp”: 1681196269  
}

and my sdk app client id is " lAzXXLSJQyKbYI1xZwqQOw" so it looks fine. Still I am getting

1. errorCode: 3712
2. errorMessage: “Signature is invalid.”
3. method: “join”
4. result: “Invalid signature.”
5. status: false

So, not sure why it is even when i am doing all steps correctly

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 11, 2023, 5:46am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/16 "2023-04-11T05:46:14Z")

</div>

One more additional info, i already had a sdk app type created before feb, but its being depricated so i have created new one and tested using new app’s credentials

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/c/fcd2e37878294ad8541b81739298802e51460764.png)

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 11, 2023, 5:56am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/18 "2023-04-11T05:56:22Z")

</div>

Same issue with CDN

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/4/f4af1c5a6204c7fd3f221f012fc8e80c29dcb35f.png)

---

<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:** [April 11, 2023, 6:05am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/19 "2023-04-11T06:05:10Z")

</div>

is you meeting app active?

in my working (free) account with a “new” Meeting SDK is looks

 ![app](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/a/c/acbbf88cc96cc87bb4469b0f31bd145e91e84cef.png)

---

<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:** [April 11, 2023, 6:07am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/20 "2023-04-11T06:07:29Z")

</div>

you don’t use “localhost” ? I did’t know that file protocoll is working - I have never tested it

UPDATE: just testet - file-protocoll work also for me

---

<div class="post-metadata">

**Author:** ![varcityzoom1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/varcityzoom1/32/47336_2.png) [@varcityzoom1](https://devforum.zoom.us/u/varcityzoom1)\
**Post date:** [April 11, 2023, 6:56am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/22 "2023-04-11T06:56:26Z")

</div>

Update: it work after retrying 4-5 times in cdn

---

<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:** [April 11, 2023, 7:42am UTC](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280/23 "2023-04-11T07:42:59Z")

</div>

perhaps you have a problem with the local time on your computer - if it’s some seconds wrong, such errors can happen

[Next page](https://devforum.zoom.us/t/signature-invalid-in-meeting-sdk-app-type-in-nextjs/86280.md?page=2)
