# \[WebSDK 2.9.7\] Signature is invalid

**URL:** <https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269>\
**Category:** Web\
**Created:** [January 28, 2023, 8:41am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269 "2023-01-28T08:41:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedonnodev](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dedonnodev](https://devforum.zoom.us/u/dedonnodev)\
**Post date:** [January 28, 2023, 8:41am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/1 "2023-01-28T08:41:58Z")

</div>

Hi there,  
I don’t understand why I’m getting “Signature is invalid.”  
i already read all topics about this thing, but didn’t find a solution.

I’m using WebSDK 2.9.7  
I’m generating signature locally in angular (just for testing) with this code:

```auto
   _generateSignature({
    sdkKey,
    sdkSecret,
    meetingNumber,
    role
  }: {
    sdkKey: string;
    sdkSecret: string;
    meetingNumber: string;
    role: number;
  }): string {
    const iat = Math.round(new Date().getTime() / 1000 - 60);
    const exp = iat + 60 * 60 * 2;
    const oHeader = { alg: 'HS256', typ: 'JWT' };

    const oPayload = {
      sdkKey: sdkKey,
      mn: meetingNumber,
      role: role,
      iat: iat,
      exp: exp,
      appKey: sdkKey,
      tokenExp: iat + 60 * 60 * 2
    };

    const sHeader = JSON.stringify(oHeader);
    const sPayload = JSON.stringify(oPayload);
    const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret);
    consoleDev(signature);
    return signature;
  }

```

And call a component view with this code

```auto
await client.init({ zoomAppRoot: meetingSDKElement!, language: 'it-IT' });
    await client.join({
      sdkKey: sdkKey,
      signature: this._generateSignature({
        sdkKey,
        sdkSecret,
        meetingNumber,
        role
      }),
      meetingNumber,
      userName,
      success: (_: any) => {
        console.log('joined');
      },
      error: (error: any) => {
        console.log(error);
      }
    });

```

checking data using [jwt.io](http://jwt.io) looks legitimate to me.

What else can i check?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 28, 2023, 8:56am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/2 "2023-01-28T08:56:55Z")

</div>

@dedonnodev Hope you will be fine.

Here are the sessions regarding WebSDK Integrations

- [Zoom Meeting SDK Integration with VueJS](https://youtu.be/CMpe56VoTTo)
- [Zoom Meeting SDK Integration with ReactJS](https://youtu.be/4BgkLvH7T0Y)
- [Zoom Meeting SDK Integration with AngularJS](https://youtu.be/utXjISjjHOY)
- [NextJS - Zoom WebSDK Component View](https://youtu.be/mwta4hZOtpc)
- [Zoom Meeting SDK Client View Integration](https://youtu.be/zaIhI_BZKJo)

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dedonnodev](https://devforum.zoom.us/u/dedonnodev)\
**Post date:** [January 28, 2023, 9:22am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/3 "2023-01-28T09:22:46Z")

</div>

I followed also those videos, but i got always Signature is invalid

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 28, 2023, 9:30am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/4 "2023-01-28T09:30:51Z")

</div>

@dedonnodev NodeJS Signature Sample 👇

```auto
const KJUR = require('jsrsasign');

function signatureHelper(req, res) {
    const iat = Math.round(new Date().getTime() / 1000) - 30;
    const exp = iat + 60 * 60 * 2

    const Header = {
        alg: 'HS256',
        typ: 'JWT'
    };

    const Payload = {
        sdkKey: 'SDK-KEY',
        mn: req.body.meetingNumber,
        role: req.body.role,
        iat: iat,
        exp: exp
    };

    const sHeader = JSON.stringify(Header);
    const sPayload = JSON.stringify(Payload);

    const meetingSignature = KJUR.KJUR.jws.JWS.sign('HS256', sHeader, sPayload, 'SDK-SECRET');

    return res.json({
        signature: meetingSignature,
        sdkKey: 'SDK-KEY'
    });
}

```

---

<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:** [January 28, 2023, 2:55pm UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/5 "2023-01-28T14:55:56Z")

</div>

you can check if Meeting SDK key/secret are active and working

the sample app on github is suitable for this

> **[GitHub - zoom/meetingsdk-web-sample: Zoom Meeting SDK Web Sample App](https://github.com/zoom/meetingsdk-web-sample)**
>
> Zoom Meeting SDK Web Sample App. Contribute to zoom/meetingsdk-web-sample development by creating an account on GitHub.

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

```auto
CDN/js/index.js:20 var SDK_KEY = "YOUR_SDK_KEY";
CDN/js/index.js:26 var SDK_SECRET = "YOUR_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:** ![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:** [January 30, 2023, 4:04am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/6 "2023-01-30T04:04:06Z")

</div>

@dedonnodev ,

Are you still having issues with this?  
Let me know, and I’ll see how I can help to triage this.

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dedonnodev](https://devforum.zoom.us/u/dedonnodev)\
**Post date:** [January 30, 2023, 8:46am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/7 "2023-01-30T08:46:49Z")

</div>

Hi there, also with “meetingsdk-web-sample” i got “Signature is invalid.”  
but i don’t understand how.  
With an old version of sdk “2.3.5” it works.

Same keys, same meeting.

---

<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:** [January 30, 2023, 3:04pm UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/8 "2023-01-30T15:04:33Z")

</div>

@dedonnodev ,

previously on 2.3.5, were you using API key? In version 2.7 and above, you will need to use SDK Key instead

[https://marketplace.zoom.us/docs/guides/build/jwt-app/jwt-app-migration/#migration-guide-for-meeting-sdk-for-web-using-a-zoom-jwt-app-type](https://marketplace.zoom.us/docs/guides/build/jwt-app/jwt-app-migration/#migration-guide-for-meeting-sdk-for-web-using-a-zoom-jwt-app-type)

Let me know if you need more details, will be happy to walk you thru this

---

<div class="post-metadata">

**Author:** ![dedonnodev](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dedonnodev](https://devforum.zoom.us/u/dedonnodev)\
**Post date:** [January 30, 2023, 3:26pm UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/9 "2023-01-30T15:26:13Z")

</div>

I didn’t know there was that guide.  
Now that i converted jwt to sdk everything works.

Thank you

---

<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:** [March 2, 2023, 1:27am UTC](https://devforum.zoom.us/t/websdk-2-9-7-signature-is-invalid/82269/10 "2023-03-02T01:27:09Z")

</div>

Closed on March 2, 2023, 1:27am UTC

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