# WebSdk 2.9.5 intermittent "invalid signature" when joining Meeting

**URL:** <https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534>\
**Category:** Web\
**Created:** [January 16, 2023, 7:56pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534 "2023-01-16T19:56:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 16, 2023, 7:56pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/1 "2023-01-16T19:56:42Z")

</div>

Hi,  
When Joining a meeting with SDK 2.9.5, sometimes I get “invalid signature” error. (It shows the zoom pop-up with the message).

The signature is not undefined and it is fetched from our GraphQL Api, and sometimes when you hit “retry” button it joins the meeting, sometimes not.

Back-end is not accusing any error and the signature is retrieve before we join the meeting. Most of the time it works on first Join.

**Browser Console Error**  
{type: ‘JOIN\_MEETING\_FAILED’, reason: ‘Signature is invalid.’, errorCode: 3712}

**Which Web Meeting SDK version?**  
2.9.5

**Meeting SDK Code Snippets**  
The code snippets that are causing the error / issue so we can reproduce.

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Go to ‘…’
2. Click on ‘…’
3. Scroll down to ‘…’
4. See error

**Screenshots**  
If applicable, add screenshots to help explain your problem.

**Troubleshooting Routes**  
The troubleshooting attempt types you’ve already exhausted, including testing with the appropriate sample app (found on [Zoom · GitHub](https://github.com/zoom)).

**Device (please complete the following information):**

- Device: [e.g. Macbook Pro]
- OS: [e.g. macOS 11]
- Browser: Chrome
- Browser Version : Most up-to-date

**Additional context**  
Add any other context about the problem here.

---

<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 17, 2023, 2:22am UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/2 "2023-01-17T02:22:11Z")

</div>

@eliseu.baldo ,

could you share how you might be generating the signature?

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 17, 2023, 3:02pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/3 "2023-01-17T15:02:38Z")

</div>

Here’s how we do :

@SneakyThrows  
public String generateSdkSignature(String meetingNumber, Optional optionalRole) {  
try {  
log.debug(  
String.format(  
“generateSignature:: meetingNumber: %s, role: %s”, meetingNumber, optionalRole));  
Integer role = optionalRole.isPresent() ? optionalRole.get() : PARTICIPANT\_ROLE;  
Mac hasher = Mac.getInstance(HMAC\_SHA\_256);  
long iat = Math.round((new Date().getTime() - 30000) / 1000);  
long exp = iat + 60 \* 60 \* 2;  
String header = “{"alg":"HS256","typ":"JWT"}”;  
String header64 = Base64.getUrlEncoder().encodeToString(header.getBytes());  
String payload =  
String.format(  
“{”  
+ “"sdkKey":"%s",”  
+ “"mn":"%s",”  
+ “"role":%d,”  
+ “"iat":%d,”  
+ “"exp":%d,”  
+ “"appKey":"%s",”  
+ “"tokenExp":%d”  
+ “}”,  
zoomProperties.getSdkKey(),  
meetingNumber,  
role,  
iat,  
exp,  
zoomProperties.getSdkKey(),  
exp);  
String payload64 =  
Base64.getUrlEncoder().encodeToString(payload.getBytes()).replaceAll(“\=+$”, “”);  
hasher.init(new SecretKeySpec(zoomProperties.getSdkSecret().getBytes(), HMAC\_SHA\_256));  
byte hash = hasher.doFinal((header64 + “.” + payload64).getBytes());  
String hashBase64Str = DatatypeConverter.printBase64Binary(hash).replaceAll(“\=+$”, “”);  
String tmpString = String.format(“%s.%s.%s”, header64, payload64, hashBase64Str);  
return tmpString;  
} catch (NoSuchAlgorithmException | InvalidKeyException e) {  
log.error(“Error in generate signature”, e);  
throw e;  
}  
}

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 20, 2023, 3:11pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/4 "2023-01-20T15:11:16Z")

</div>

Please, see below the Back-end code get the signature

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 25, 2023, 5:09pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/5 "2023-01-25T17:09:49Z")

</div>

Hey @eliseu.baldo ,

I have a few questions that will help us investigate this.

1. When did you create your Meeting SDK app type?

2. Was this working for you and then recently stop working?

3. Are you running your generation code on the server side in the UTC timezone?

Best,  
Tommy

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 25, 2023, 7:52pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/6 "2023-01-25T19:52:23Z")

</div>

Hey @tommy ,

When did you create your Meeting SDK app type?

- Right before joining the meeting, we generate token

Was this working for you and then recently stop working?

- Before this we using API key to generate signature. Even this signature it is failing intermittently. 1 out of 5 times, it generates error

Are you running your generation code on the server side in the UTC timezone?

- Yes, server side is IN UTC timezone.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 25, 2023, 8:24pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/7 "2023-01-25T20:24:43Z")

</div>

Hey @eliseu.baldo ,

Thanks for your answers. Can you let me know when you created your Meeting SDK app type in the [marketplace build flow](https://marketplace.zoom.us/)?

Best,  
Tommy

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 25, 2023, 8:30pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/8 "2023-01-25T20:30:04Z")

</div>

Hey @tommy  
It was created november 1st 2022

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 25, 2023, 8:40pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/9 "2023-01-25T20:40:56Z")

</div>

Thanks @eliseu.baldo ,

And can you confirm you are using the SDK Key and SDK Secret to generate the Meeting SDK JWT, or the OAuth Client ID and Client Secret?

You will need to use SDK Key and SDK Secret.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 25, 2023, 8:58pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/10 "2023-01-25T20:58:00Z")

</div>

Yes, we are using SDK Key and SDK Secret to generate the meeting JWT.

OAuth is used to communicate with zoom server on the BE.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 25, 2023, 9:11pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/11 "2023-01-25T21:11:24Z")

</div>

Okay thanks, everything looks correct on your end.

We are taking a look around any timestamp logic improvements.

In the meantime, we did see this suggestion: [Invalid signature after migrating to SDK JWT (v2.9.7)](https://devforum.zoom.us/t/invalid-signature-after-migrating-to-sdk-jwt-v2-9-7/82045)

Best,  
Tommy

---

<div class="post-metadata">

**Author:** ![eliseu.baldo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eliseu.baldo/32/44574_2.png) [@eliseu.baldo](https://devforum.zoom.us/u/eliseu.baldo)\
**Post date:** [January 27, 2023, 1:43pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/12 "2023-01-27T13:43:52Z")

</div>

Hi @tommy ,

that solution did work for now. Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [January 27, 2023, 4:22pm UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/13 "2023-01-27T16:22:41Z")

</div>

Happy to hear that @eliseu.baldo !

-Tommy

---

<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:** [February 27, 2023, 2:22am UTC](https://devforum.zoom.us/t/websdk-2-9-5-intermittent-invalid-signature-when-joining-meeting/81534/14 "2023-02-27T02:22:50Z")

</div>

Closed on February 27, 2023, 2:22am UTC

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