# Web - Joining meeting timeout - Signature is invalid

**URL:** <https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577>\
**Category:** Meetings\
**Tags:** api, sdk\
**Created:** [April 29, 2023, 7:01am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577 "2023-04-29T07:01:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [April 29, 2023, 7:01am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/1 "2023-04-29T07:01:39Z")

</div>

Hi,

I am using web SDK to join a meeting and server-to-server OAuth for creating a meeting.

When joining the meeting I am passing the Role=1 in signature to join as host, but while joining meeting, it says

Joining meeting timeout  
Signature is invalid.

With following error message  
{  
“method”: “join”,  
“status”: false,  
“result”: “Invalid signature.”,  
“errorMessage”: “Signature is invalid.”,  
“errorCode”: 3712  
}

Function to get sdk signature  
eg: meetingNumber = 87483833442, role = 1

```auto
const getMsdkSignature = asyncHandler(async (req, res) => {
  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.CLIENT_ID,
    appKey: process.env.CLIENT_ID,
    mn: +req.body.meetingNumber,
    role: +req.body.role,
    iat: iat,
    exp: exp,
    tokenExp: exp,
  };

  const sHeader = JSON.stringify(oHeader);
  const sPayload = JSON.stringify(oPayload);
  const signature = KJUR.jws.JWS.sign(
    "HS256",
    sHeader,
    sPayload,
    process.env.CLIENT_SECRET
  );

  res.json({
    signature: signature,
  });
});

```

Web sdk as client view  
SDK version - 2.11.0

```auto
ZoomMtg.init({
      leaveUrl: LEAVE_URL,
      success: (success) => {
        console.log(success)

        ZoomMtg.join({
          signature,
          meetingNumber: +mn,
          sdkKey: process.env.CLIENT_ID,
          userName: "abcd",
          passWord: pw,
          success: (success) => {
            console.log(success)
          },
          error: (error) => {
            console.log('Error is....',error)
          }
        })
      },
      error: (error) => {
        console.log(error)
      }
    })

```

May I know where I am going wrong.  
Thanks.

EDIT:  
After debugging issue, I found out that signature created is invalid by above getMsdkSignature function. When I decode it in [jwt.io](http://jwt.io) website, it says invalid signature. Whats the correct way to generate signature ?

Decoded token data

{  
“sdkKey”: “63QyZ…”,  
“appKey”: “63QyZ…”,  
“mn”: “82376833897”,  
“role”: 1,  
“iat”: 1682775672,  
“exp”: 1682782872,  
“tokenExp”: 1682782872  
}

---

<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 29, 2023, 2:32pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/2 "2023-04-29T14:32:46Z")

</div>

what happens if you join as “attendee” (role = 0)?

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [April 30, 2023, 7:53am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/5 "2023-04-30T07:53:45Z")

</div>

I updated zoomwebsdk to 2.11.5 and its working fine now. But another issue is I am not able to end meeting, also leave meeting is not working when joined as attendee and there are no logs in console. Can you help me out ?

---

<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 30, 2023, 12:55pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/6 "2023-04-30T12:55:42Z")

</div>

do you use React?

meeting SDK 2.11.5 uses [React v16.13.0](https://source.zoom.us/2.11.5/lib/vendor/react.min.js) (until SDK 2.6.0 [React v16.8.6](https://source.zoom.us/2.6.0/lib/vendor/react.min.js))

with newer React versions the “leave meeting” button seems to have no function

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [April 30, 2023, 1:11pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/7 "2023-04-30T13:11:20Z")

</div>

Yes, I am using Nextjs with following dependency versions

“next”: “13.3.1”,  
“react”: “18.2.0”,  
“react-dom”: “18.2.0”

If I want to use react v16, I need to downgrade nextjs to v10, which is not what I want.  
Is there any other solution ?

---

<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 30, 2023, 2:07pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/8 "2023-04-30T14:07:57Z")

</div>

just an idea - you could embed the meeting sdk in an iframe

in the iframe react 16, outsite the iframe react 18

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 1, 2023, 10:17am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/9 "2023-05-01T10:17:36Z")

</div>

Its working now without using iframe, just had to delete node\_modules and run command → npm install, but there is another problem, gallery view button is not visible even after setting headers.

```auto
app.use((req, res, next) => {
  res.set('Cross-Origin-Embedder-Policy', 'require-corp')
  res.set('Cross-Origin-Opener-Policy', 'same-origin')

  next();
});

```

Response headers are being set but when I type

```auto
typeof SharedArrayBuffer === 'function'; -> false
crossOriginIsolated -> false

```

Can you help me over here ?

---

<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 1, 2023, 2:13pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/10 "2023-05-01T14:13:13Z")

</div>

try change ‘**res.set( … )**’ to ‘**res.setHeader( … )**’

> **[Node.js response.setHeader() Method - GeeksforGeeks](https://www.geeksforgeeks.org/node-js-response-setheader-method/)**
>
> A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 1, 2023, 3:59pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/11 "2023-05-01T15:59:08Z")

</div>

I tried already, still its not working.

---

<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 1, 2023, 5:16pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/12 "2023-05-01T17:16:51Z")

</div>

do you see in the browser dev-tools the correct header?

 ![header](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/d/c/dc5bdc2aa0d62da391479316155ed78b39517d0b.png)

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 1, 2023, 5:32pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/13 "2023-05-01T17:32:05Z")

</div>

Yes, I can see attaching ss for your reference.

 ![Screenshot 2023-05-01 at 11.01.30 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/a/2ae0a10f1f09bfb4444b25c4ab0b425dd99be2b6.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:** [May 2, 2023, 5:05am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/14 "2023-05-02T05:05:44Z")

</div>

then it may be that the whole methode does not work with http and localhost - but I have not found anything about it

---

<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 2, 2023, 5:08am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/15 "2023-05-02T05:08:42Z")

</div>

which browser are you using?

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 2, 2023, 5:28am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/16 "2023-05-02T05:28:09Z")

</div>

I am using chrome browser.

---

<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 2, 2023, 6:38am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/17 "2023-05-02T06:38:28Z")

</div>

what’s the result, when you enter in the console (while the started meeting)

> window.crossOriginIsolated

true or false?

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 2, 2023, 7:22am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/18 "2023-05-02T07:22:50Z")

</div>

The value is false for both commands:

typeof SharedArrayBuffer === ‘function’  
window.crossOriginIsolated

---

<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 2, 2023, 2:12pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/19 "2023-05-02T14:12:34Z")

</div>

did you checked the header for your main **html** file(s) ?

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 2, 2023, 4:31pm UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/21 "2023-05-02T16:31:35Z")

</div>

Can you elaborate a little, didnt get you ?

---

<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 3, 2023, 5:29am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/22 "2023-05-03T05:29:44Z")

</div>

only for **delivered html files** you need the modified headers - not for json files

---

<div class="post-metadata">

**Author:** ![ronak1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ronak1/32/46044_2.png) [@ronak1](https://devforum.zoom.us/u/ronak1)\
**Post date:** [May 6, 2023, 5:36am UTC](https://devforum.zoom.us/t/web-joining-meeting-timeout-signature-is-invalid/87577/23 "2023-05-06T05:36:12Z")

</div>

For nextjs, it does not seem to work. Can you provide a sample nextjs usage would be very helpful.
