# Getting error Signature is Invalid - Web SDK Integration

**URL:** <https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215>\
**Category:** Web\
**Created:** [October 23, 2023, 11:07am UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215 "2023-10-23T11:07:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imrangmworld](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/imrangmworld/32/53229_2.png) [@imrangmworld](https://devforum.zoom.us/u/imrangmworld)\
**Post date:** [October 23, 2023, 11:07am UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215/1 "2023-10-23T11:07:49Z")

</div>

Hi,

I need technical support for the Zoom Web SDK. I am getting an error message “Signature is Invalid”

Here are the steps I followed.

1. Downloaded the SDK Web sample from github.  
Project: meetingsdk-web-sample

2. Modified Index.js file accordingly. Added Client Key and Secret as per given instructions.

3. Run the `npm install` command. It installed the node\_modules in the CDN folder. (NPM is Latest)

4. Run the `npm start` command to run the sample application.

5. Sample application was running, I added meeting ID and password etc and hit the Join button. It was showing the signature invalid screen.

After downloading the web sample app, I added the secret and client Ids.

---

<div class="post-metadata">

**Author:** ![zenpro](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/zenpro/32/53240_2.png) [@zenpro](https://devforum.zoom.us/u/zenpro)\
**Post date:** [October 23, 2023, 12:57pm UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215/2 "2023-10-23T12:57:44Z")

</div>

Getting the same error here. It was fine yesterday.

---

<div class="post-metadata">

**Author:** ![jenzushsu](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jenzushsu/32/34251_2.png) [@jenzushsu](https://devforum.zoom.us/u/jenzushsu)\
**Post date:** [October 23, 2023, 2:15pm UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215/3 "2023-10-23T14:15:21Z")

</div>

Hi @imrangmworld,

Thanks for reaching out to us and welcome to our community!

I will remove your screen capturing video and source code links as it’s exposing your SDK credentials and meeting details. I will encourage you to regenerate the SDK secret.

Are you using the right SDK from Meeting SDK? You can refer to this link [Meeting SDK Auth](https://developers.zoom.us/docs/meeting-sdk/auth/)

---

<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 8, 2023, 7:55pm UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215/4 "2023-11-08T19:55:23Z")

</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.

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

```
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)  
);

```
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:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [December 9, 2023, 5:55am UTC](https://devforum.zoom.us/t/getting-error-signature-is-invalid-web-sdk-integration/97215/5 "2023-12-09T05:55:47Z")

</div>

Closed on December 9, 2023, 5:55am UTC

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