# Error during ZoomMtg.join() call in JavaScript SDK.

**URL:** <https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237>\
**Category:** Web\
**Created:** [May 18, 2017, 9:59pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237 "2017-05-18T21:59:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raghu\_Gorur](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Raghu\_Gorur](https://devforum.zoom.us/u/Raghu_Gorur)\
**Post date:** [May 18, 2017, 9:59pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/1 "2017-05-18T21:59:49Z")

</div>

I was going through the demo code given in&nbsp;[https://github.com/zoomvideo/webclient.&nbsp;](https://github.com/zoomvideo/webclient.%C2%A0)

When I tried calling ZoomMtg.join() given in customer.js, it is giving me the error - &nbsp;{status: false, errorCode: 200, errorMessage: “No permission”, result: null, method: “join”}

apiKey and apiSecret key are the same what I use for iOS SDK where it is working fine. Can anybody help me with it?&nbsp;

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 18, 2017, 10:19pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/2 "2017-05-18T22:19:58Z")

</div>

Hi Raghu,

“no permission” means that the signature you generated is not valid. Please remember that the signature only valid for 24 hours.

Best

---

<div class="post-metadata">

**Author:** ![Raghu\_Gorur](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@Raghu\_Gorur](https://devforum.zoom.us/u/Raghu_Gorur)\
**Post date:** [May 19, 2017, 2:07am UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/3 "2017-05-19T02:07:27Z")

</div>

I am trying to create Signature using the code given in webclient\_v1.pdf

In the code, I coudn’t get&nbsp; Crypto.hmacSha256() class. So I created one for that as below

String hmacSha256(byte data, byte secretKey) throws Exception {  
String hash = “”;

Mac sha256\_HMAC = Mac.getInstance(“HmacSHA256”);  
SecretKeySpec secret\_key = new SecretKeySpec(secretKey, “HmacSHA256”);  
sha256\_HMAC.init(secret\_key);

hash = Base64.encodeBase64String(sha256\_HMAC.doFinal(data));

return hash;  
}

Will this work?

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 19, 2017, 5:14pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/4 "2017-05-19T17:14:30Z")

</div>

Hi Raghu,

if you got “no permission”, it means your algorithm has some issues. One example to implement hmacSha256():

public static byte hmacSha256(byte data, byte key) {

return hmac(HMAC\_SHA256, data, key);

}

public static byte hmac(String algorithm, byte data, byte key) {

try {

SecretKeySpec signingKey = new SecretKeySpec(key, algorithm);

Mac mac = Mac.getInstance(algorithm);

mac.init(signingKey); return mac.doFinal(data);

} catch (Exception e) {

throw new RuntimeException(e);

}

Best

---

<div class="post-metadata">

**Author:** ![mingche](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mingche](https://devforum.zoom.us/u/mingche)\
**Post date:** [May 23, 2017, 12:58am UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/5 "2017-05-23T00:58:40Z")

</div>

Hey Wei,&nbsp;

After trying your custom implementation of the hmacSha256() method, there is NoSuchAlgorithmException.

&nbsp;

Which is the correct crypto package we should be using?&nbsp;

These are the packages in use at the moment:&nbsp;

import javax.crypto.Mac;  
import javax.crypto.spec.SecretKeySpec;

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 23, 2017, 1:04am UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/6 "2017-05-23T01:04:07Z")

</div>

Hi Ming,

I am also using&nbsp;

import javax.crypto.Mac;  
import javax.crypto.spec.SecretKeySpec;

Best

---

<div class="post-metadata">

**Author:** ![mingche](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mingche](https://devforum.zoom.us/u/mingche)\
**Post date:** [May 23, 2017, 1:27am UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/7 "2017-05-23T01:27:34Z")

</div>

in this function you have provided

public static byte hmacSha256(byte data, byte key) {

return hmac(HMAC\_SHA256, data, key);

}

What is the HMAC\_SHA256 variable set to?

Also have tried using “HmacSHA256” as per the javadocs, but still gets NoSuchAlgorithmException. Am I missing something?&nbsp;

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 23, 2017, 1:45am UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/8 "2017-05-23T01:45:17Z")

</div>

Hi Ming,

HMAC\_SHA256 = “HmacSHA256”

Best

---

<div class="post-metadata">

**Author:** ![mingche](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mingche](https://devforum.zoom.us/u/mingche)\
**Post date:** [May 23, 2017, 7:31pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/9 "2017-05-23T19:31:15Z")

</div>

Still get the NoSuchAlgorithm when using that value.

&nbsp;

Here is a python implementation. Still getting the No Permission error. Does this look right?&nbsp;

import base64  
import time  
import hmac  
import hashlib

apiKey = ‘mykey’  
apiSecret = ‘secrit’  
apiSecretUTF8 = unicode(apiSecret, ‘utf-8’)  
meetingNumber = str(140723271)  
ts = str(int(time.time() \* 1000))  
role = str(1)

data = base64.standard\_b64encode( unicode((apiKey + meetingNumber + ts + role), ‘utf-8’ ))

m = hashlib.sha256()  
m.update(data + apiSecretUTF8)  
\_hash = m.digest()

s = apiKey + ‘.’ + meetingNumber + ‘.’ + ts + ‘.’ + role + ‘.’ + base64.standard\_b64encode(\_hash)  
signature = base64.urlsafe\_b64encode(unicode(s, ‘utf-8’))  
print signature

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 23, 2017, 8:01pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/10 "2017-05-23T20:01:19Z")

</div>

Hi Ming,

one thing you should be aware of is that you should use **API key and API secret**. NOT APP key and APP secret. Your algorithm looks correct.&nbsp;

For next release, we will add this logic to code so that you don’t need to do it on your own.

Best

---

<div class="post-metadata">

**Author:** ![mingche](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mingche](https://devforum.zoom.us/u/mingche)\
**Post date:** [May 23, 2017, 8:53pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/11 "2017-05-23T20:53:22Z")

</div>

Yes we are using API key and secret, I just obfuscated the actual values with the dummy values you see

---

<div class="post-metadata">

**Author:** ![mingche](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@mingche](https://devforum.zoom.us/u/mingche)\
**Post date:** [May 25, 2017, 6:57pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/12 "2017-05-25T18:57:58Z")

</div>

Hi Wei,

Do you have&nbsp;an estimated date for new SDK version release?

Best

---

<div class="post-metadata">

**Author:** ![Wei\_Guo1](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wei\_Guo1](https://devforum.zoom.us/u/Wei_Guo1)\
**Post date:** [May 25, 2017, 7:24pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/13 "2017-05-25T19:24:54Z")

</div>

Hi Mingche,

the release will be around end of June.

Best

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 5:11pm UTC](https://devforum.zoom.us/t/error-during-zoommtg-join-call-in-javascript-sdk/237/14 "2020-08-21T17:11:40Z")

</div>

Closed on August 21, 2020, 5:11pm UTC


