# Video SDK JWT token invalid

**URL:** <https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166>\
**Category:** Web\
**Tags:** video-sdk\
**Created:** [October 3, 2023, 12:30pm UTC](https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166 "2023-10-03T12:30:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![monali.patel](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@monali.patel](https://devforum.zoom.us/u/monali.patel)\
**Post date:** [October 3, 2023, 12:30pm UTC](https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166/1 "2023-10-03T12:30:37Z")

</div>

### Video SDK JWT token invalid:

_I am using the React-demo of the Zoom Video SDK, version 1.5.5 and I get the error_

* * *

**Description**  
I have the following function to generate the JWT token. But when the token is used, the error above shows and the SDK does not start.

**Browser Console Error**

```auto
{
type: 'JOIN_MEETING_FAILED',
reason: 'Verify JWT failed',
errorCode: 200
}

```

**Which Web Video SDK version?**  
Zoom Video SDK, version 1.5.5

**Video SDK Code Snippets**

```auto
generateVideoToken(
  sdkKey: string,
  sdkSecret: string,
  topic: string,
  passWord = '',
  userIdentity = '',
  sessionKey = '',
  roleType = 1
) {
  let signature = '';
  try {
    const iat = Math.round(new Date().getTime() / 1000);
    const exp = iat + 60 * 60 * 2;
    // Header
    const oHeader = { alg: 'HS256', typ: 'JWT' };
    // Payload
    const oPayload = {
      app_key: sdkKey,
      iat,
      exp,
      tpc: topic,
      pwd: passWord,
      user_identity: userIdentity,
      session_key: sessionKey,
      role_type: roleType // role = 1 for host, 0 for attendee; a host must first start a session for attendees to join
      // topic
    };
    const sHeader = JSON.stringify(oHeader);
    const sPayload = JSON.stringify(oPayload);
    signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret);
  } catch (e) {
    console.error(e);
  }
  return signature;
}

```

**Additional context**  
Please state what might be wrong here because this has been working for the past 6 months of usage, but the error just surfaced recently.

---

<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:** [October 3, 2023, 8:03pm UTC](https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166/2 "2023-10-03T20:03:46Z")

</div>

Hi, @monali.patel.

Have you verified your token with [JWT.io](http://jwt.io/)? Also, here is a troubleshooting guide on Meeting SDK JWT, which you can refer to for troubleshooting the Video JWT as well.

> **[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...

Make sure to check that your computer clock is correct as well. I’ve seen developers encounter issues with JWT when their clock is incorrect.

---

<div class="post-metadata">

**Author:** ![monali.patel](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@monali.patel](https://devforum.zoom.us/u/monali.patel)\
**Post date:** [October 4, 2023, 8:07am UTC](https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166/3 "2023-10-04T08:07:45Z")

</div>

Hi Donte

Thanks for your response. I did verification with [JWT.io](http://JWT.io) and received message like invalid signature  
Although the data in the token is correct, as seen on the right-hand side of the picture, it doesn’t seem to be valid.

---

<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:** [November 3, 2023, 6:08pm UTC](https://devforum.zoom.us/t/video-sdk-jwt-token-invalid/96166/4 "2023-11-03T18:08:41Z")

</div>

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