# Error in Generation of Signature

**URL:** <https://devforum.zoom.us/t/error-in-generation-of-signature/103050>\
**Category:** Meeting SDK\
**Created:** [February 2, 2024, 5:32am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050 "2024-02-02T05:32:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrph](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rrph](https://devforum.zoom.us/u/rrph)\
**Post date:** [February 2, 2024, 5:32am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/1 "2024-02-02T05:32:36Z")

</div>

I Cloned the Git hub Repo: [GitHub - zoom/meetingsdk-react-sample: Use the Zoom Meeting SDK in React](https://github.com/zoom/meetingsdk-react-sample).

After setting up all the essential Parameters inside it, when I was joining the meeting. the following error was showing in the browser console :

1. errorCode: 3712
2. reason: “Signature is invalid.”
3. type: “JOIN\_MEETING\_FAILED”

I checked the Signature on the [JWT.IO](http://JWT.IO) also. The signature was verified. I don’t know what is the problem.

---

<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:** [February 2, 2024, 8:34am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/2 "2024-02-02T08:34:36Z")

</div>

@rrph

do you have a sample of the JWT token?

---

<div class="post-metadata">

**Author:** ![rrph](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rrph](https://devforum.zoom.us/u/rrph)\
**Post date:** [February 2, 2024, 8:43am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/3 "2024-02-02T08:43:28Z")

</div>

This is my code for signature at server side :

```auto
app.post('/signature', (req, res) => {
    console.log('Request body:', req.body);
    const { meetingNumber, role } = req.body;

        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.API_KEY,
            mn: meetingNumber,
            role: role,
            iat: iat,
            exp: exp,
            appKey: process.env.API_KEY,
            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.API_SECRET);

        res.json({ signature });

});

```

---

<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:** [February 2, 2024, 8:51am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/4 "2024-02-02T08:51:55Z")

</div>

@rrph , this code looks ok.

Do you have the generated token?

There is a possibility when calling the API, the `content-type` in the POST is not set as `application/json`, causing the server side to receive “nothing” for `meetingNumber` and `role`

Having the generated token will help in troubleshooting

---

<div class="post-metadata">

**Author:** ![rrph](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rrph](https://devforum.zoom.us/u/rrph)\
**Post date:** [February 2, 2024, 10:36am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/5 "2024-02-02T10:36:07Z")

</div>

I had set the content-type correctly as : application/json. My token generated is : “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiI5WU81WExQU3ZXdWpxbmxIVWM3cUEiLCJpYXQiOjE3MDY4Njk1NTIsImV4cCI6MTcwNjg3Njc1MiwiYXBwS2V5IjoiOVlPNVhMUFN2V3VqcW5sSFVjN3FBIiwidG9rZW5FeHAiOjE3MDY4NzY3NTJ9.6-\_BSle15I0LGCS0z2SXwyUVQ2k8SyKhMGLh4-2cBT8”.

---

<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:** [February 2, 2024, 8:04pm UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/6 "2024-02-02T20:04:54Z")

</div>

@rrph Hope you will be fine.

Here is [session](https://youtu.be/4BgkLvH7T0Y) about Zoom WebSDK Integration.

---

<div class="post-metadata">

**Author:** ![rrph](https://avatars.discourse-cdn.com/v4/letter/r/e79b87/32.png) [@rrph](https://devforum.zoom.us/u/rrph)\
**Post date:** [February 3, 2024, 4:19am UTC](https://devforum.zoom.us/t/error-in-generation-of-signature/103050/7 "2024-02-03T04:19:13Z")

</div>

It is working now without changing anything. Don’t know what happened. Thank you for your support.
