# Invalid Signature Web SDK

**URL:** <https://devforum.zoom.us/t/invalid-signature-web-sdk/98154>\
**Category:** Meetings\
**Created:** [November 9, 2023, 9:18pm UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154 "2023-11-09T21:18:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 9, 2023, 9:18pm UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/1 "2023-11-09T21:18:56Z")

</div>

Hi

I can’t seem to solve this invalid signature issue. I use the ZoomClient API to successfully create a scheduled meeting. I am trying to use the function below to create a signature to start the meeting, but I keep getting an invalid signature error. I’m using the web (component view). My credentials are Server-To-Server OAuth. Please help. I appreciate help from any body. Thanks

function generateSignature(key, secret, meetingNumber, role) {  
const iat = Math.floor(Date.now() / 1000) - 30;  
const exp = iat + 60 \* 60 \* 2;

```auto
const oHeader = {
    alg: "HS256",
    typ: "JWT"
};

const oPayload = {
    appKey: key,
    sdkKey: key,
    meetingNumber: meetingNumber,
    role: role,
    iat: iat,
    exp: exp
};

// Define the HMACSHA256 function inline
function HMACSHA256(key, message) {
    const hash = CryptoJS.HmacSHA256(message, key);
    return CryptoJS.enc.Base64.stringify(hash);
}

// Create the encoded header and payload strings
const encodedHeader = btoa(JSON.stringify(oHeader));
const encodedPayload = btoa(JSON.stringify(oPayload));

// Generate the signature using HMAC SHA-256
const signature = HMACSHA256(secret, encodedHeader + "." + encodedPayload);

return signature;

```

}

async function initializeZoomMeeting() {  
const client = ZoomMtgEmbedded.createClient();  
const meetingSDKElement = document.getElementById(‘meetingSDKElement’);  
const sdkKey = getCookie(“sdkKeyCookie”);  
const secret = getCookie(“secretCookie”);  
const mn = getCookie(“meetingIDCookie”)  
client.init({ zoomAppRoot: meetingSDKElement, language: ‘en-US’ });  
const generatedSignature = generateSignature(  
sdkKey,  
secret,  
mn, // Meeting Number  
1 // Role (0 for a host, 1 for a participant)  
);

```auto
try {
    client.join({
        sdkKey: clientID,
        signature: generatedSignature, // role in SDK signature needs to be 1
        meetingNumber: getCookie("meetingIDCookie"),
        password: meetingPassword,
        userName: email,
        zak: zakToken
    })
    
} catch (error) {
    console.error('Error:', error);
}

```

}

// Initialize Zoom Meeting on page load.  
initializeZoomMeeting();

---

<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:** [November 10, 2023, 3:13am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/2 "2023-11-10T03:13:43Z")

</div>

@chuxyno to join Meeting with Meeting SDK, you need to use the ClientId and ClientSecret from a Meeting SDK App type instead of Server to Server Oauth app type

---

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 10, 2023, 8:58am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/3 "2023-11-10T08:58:29Z")

</div>

Thanks Chun. Does this mean I need to use both auth, or discard Server to Server Oauth for Meeting SDK auth?

---

<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:** [November 10, 2023, 9:11am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/4 "2023-11-10T09:11:22Z")

</div>

@chuxyno you will need to use S2S OAuth for your API access, and Meeting SDK Credentials for Meeting SDK Auth.

There will be 2 apps.

---

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 10, 2023, 9:22am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/5 "2023-11-10T09:22:22Z")

</div>

Thanks. Will try it now

---

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 11, 2023, 10:50pm UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/6 "2023-11-11T22:50:59Z")

</div>

Hi Chung

Can you give me a pointer on this problem? Will I create a webinar with S2S Oauth, and start and join the webinar with the Meeting SDK Auth?

I can’t seem to be able to create a meeting with Meeting SDK Auth. Generating access tokens kept failing with the authorised code.

I’ve used the Meeting SDK Auth ID and secret to try starting the meeting, but I still get an invalid signature.

Can I see sample codes to create, start, and join webinars?

---

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 12, 2023, 10:26pm UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/7 "2023-11-12T22:26:41Z")

</div>

Hi Chung

I created a webinar with S2S credentials (I haven’t been able to do the same with the Meeting SDK). I tried to start a webinar with Meeting SDK credentials but still got an invalid 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:** [November 14, 2023, 1:10am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/8 "2023-11-14T01:10:49Z")

</div>

@chuxyno , are you using the Web version of Meeting SDK?

If you are using Client View to join Webinar

> **[Meeting SDK - web - client view - Webinars](https://developers.zoom.us/docs/meeting-sdk/web/client-view/webinars/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

If you are using Component View to join Webinar

> **[Meeting SDK - web - component view - Webinars](https://developers.zoom.us/docs/meeting-sdk/web/component-view/webinars/#join-a-webinar)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![chuxyno](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chuxyno/32/53713_2.png) [@chuxyno](https://devforum.zoom.us/u/chuxyno)\
**Post date:** [November 14, 2023, 11:14pm UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/9 "2023-11-14T23:14:29Z")

</div>

Hi Chun

It’s been a week now since I’ve been on this invalid signature issue. I haven’t been able to move forward with my project. I had seen the links you sent before you sent them. How can I share my method of generating the signature, starting the webinar, and also my client ID and secret to help locate the problem? I’m using the Meeting SDK (web-compliant view) for starting and joining the webinar. I used S2S to create it.

---

<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:** [November 17, 2023, 5:07am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/10 "2023-11-17T05:07:51Z")

</div>

This thread is in PM follow up.

The solution to the thread is to use the sample from [Meeting SDK Auth](https://developers.zoom.us/docs/meeting-sdk/auth/#sample-code)

---

<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:** [November 17, 2023, 11:46am UTC](https://devforum.zoom.us/t/invalid-signature-web-sdk/98154/11 "2023-11-17T11:46:55Z")

</div>

Closed on November 17, 2023, 11:46am UTC


