# Cannot initialize Zoom SDK error code=3 internal errorcode 124

**URL:** <https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081>\
**Category:** Android\
**Created:** [June 22, 2020, 10:04pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081 "2020-06-22T22:04:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssaxena1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ssaxena1/32/10774_2.png) [@ssaxena1](https://devforum.zoom.us/u/ssaxena1)\
**Post date:** [June 22, 2020, 10:04pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/1 "2020-06-22T22:04:50Z")

</div>

**Description**  
Device is connected to the internet via VPN: Cannot initialize Zoom SDK

**Which version?**  
v4.6.21666.0429

Device is connected to the network via VPN.  
Initialize Zoom SDK using JWT token.  
Getting Zoom Error code =3 that means network unavailable.  
Internal error code = 124. There is no documentation for this error.

The device is clearly connected to the network. Why am I getting this error?

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

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

- Device: Pixel 3a
- OS: 10

---

<div class="post-metadata">

**Author:** ![abiyani](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abiyani/32/6373_2.png) [@abiyani](https://devforum.zoom.us/u/abiyani)\
**Post date:** [June 22, 2020, 11:34pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/2 "2020-06-22T23:34:24Z")

</div>

Hi,

I work on the same team as ssaxena1 and am trying to help her with this issue. I suspect our server-side code to generate the JWT is wrong, but I don’t know why. Do you see something wrong with it? (We’re using Ruby on Rails.)

```
key = Rails.application.config.virtual_visits.zoom_sdk["key"]
secret = Rails.application.config.virtual_visits.zoom_sdk["secret"]

payload = {
  appKey: key,
  iat: (Time.now.to_f * 1000).round(0),
  exp: ((Time.now + 24.hours).to_f * 1000).round(0),
  tokenExp: ((Time.now + 1.hour).to_f * 1000).round(0),
}
header = { typ: "JWT", alg: "HS256" }

message = [Base64.strict_encode64(header.to_json), Base64.strict_encode64(payload.to_json)].join(".")
signature = OpenSSL::HMAC.digest("SHA256", secret, message)

JWT.encode(payload, signature, "HS256", header)

```

I used [https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization](https://marketplace.zoom.us/docs/sdk/native-sdks/android/mastering-zoom-sdk/sdk-initialization) as a reference.

---

<div class="post-metadata">

**Author:** ![yosuke.sawamura](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/yosuke.sawamura/32/1484_2.png) [@yosuke.sawamura](https://devforum.zoom.us/u/yosuke.sawamura)\
**Post date:** [June 23, 2020, 3:43am UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/4 "2020-06-23T03:43:31Z")

</div>

Hi ssaxena and abiyan

Please make sure that you are using SDK key/secret to generate the “SDK\_JWTTOKEN” and also to make sure “appKey” (SDK key), “iat” (date of issue). “exp” (date of expire) and “tokenExp” (token expire time). (basically “exp” and “tokenExp” should be the same) are all confirmed.  
You can test these and generate at “[https://jwt.io/](https://jwt.io/)” to compare as well.

HEADR,PAYLOAD,VERIFY SIGNATURE should look like this:

```
{
  "alg": "HS256",
  "typ": "JWT"
}
{
  "appKey": "＜YOUR SDK KEY＞",
  "iat": 1592881200,
  "exp": 1592888400,
  "tokenExp": 1592888400 
}
HMACSHA256(
  base64UrlEncode(header) + "." +
  base64UrlEncode(payload),
＜YOUR SDK SECRET＞
) 

```

Another alternative way for testing purpose will be to use SDK key/secret without jwtToken.  
For Example, define “SDK\_KEY” and “SDK\_SECRET”. (e.g. on AuthConstants.java or Constants.java) and manually comment “initParams.jwtToken” and add these keys. (e.g. InitAuthSDKHelper.java or MainActivity.java)

```
 -----
 initParams.appKey = SDK_KEY;
 initParams.appSecret = SDK_SECRET;
 -----
```

---

<div class="post-metadata">

**Author:** ![abiyani](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abiyani/32/6373_2.png) [@abiyani](https://devforum.zoom.us/u/abiyani)\
**Post date:** [June 23, 2020, 5:15pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/5 "2020-06-23T17:15:50Z")

</div>

Thanks for the response @yosuke.sawamura. Unfortunately we still can’t initialize the SDK.

1. I made sure we’re using the SDK key and secret to generate the JWT
2. I verified the header and payload fields match your comment and the documentation
3. I verified the JWT I’m generating through [jwt.io](http://jwt.io), including verifying the signature

I also tried:

1. changing the “exp” and “tokenExp” to be the same value (24 hours in the future), formatted the way you pasted
2. changing the “iat”, “exp”, and “tokenExp” to be formatted in epoch time with milliseconds

None of the above helped.

We also tried using the SDK Key and Secret directly in the app and were able to initialize the Android SDK successfully. The JWT initialization, however, still isn’t working.

We also tried our JWT in the demo Android app, but it still doesn’t work.

Do you have any other suggestions? Or do you know of a working Ruby implementation for generating JWTs for the SDK?

---

<div class="post-metadata">

**Author:** ![yosuke.sawamura](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/yosuke.sawamura/32/1484_2.png) [@yosuke.sawamura](https://devforum.zoom.us/u/yosuke.sawamura)\
**Post date:** [June 24, 2020, 2:52am UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/6 "2020-06-24T02:52:37Z")

</div>

Hi abiyani

It seems you have the time stamp in milli-seconds when we prefer seconds.  
Also it might be more simple using libs form [jwt.io](http://jwt.io) if you’re not using it.  
Here is what I can provide that you might refer for further comparison…  
Since your team have reported the same question over to [developersupport@zoom.us](mailto:developersupport@zoom.us) I’ve tested your SDK ket/secret to verify init using the token generated with this.

```
#!/usr/bin/ruby

require 'jwt'

sdk_key = '<YOUR SDK KEY>'
sdk_secret ='<YOUR SDK SECRET>' 

i = (Time.now.to_f).round(0)
e = ((Time.now + 10*60*60).to_f).round(0)
t = ((Time.now + 10*60*60).to_f).round(0)

header = {
"alg": "HS256",
"typ": "JWT"
}

payload = {
"appKey": sdk_key, 
"iat": i,
"exp": e, 
"tokenExp": t
}

########### ENCODE
token = JWT.encode payload, sdk_secret, 'HS256' , header
puts token

########### DECODE
#decoded_token = JWT.decode token, sdk_secret, true, { algorithm: 'HS256' }
#puts decoded_token
```

---

<div class="post-metadata">

**Author:** ![abiyani](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/abiyani/32/6373_2.png) [@abiyani](https://devforum.zoom.us/u/abiyani)\
**Post date:** [June 24, 2020, 4:55pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/7 "2020-06-24T16:55:47Z")

</div>

Hi @yosuke.sawamura,

Thanks for providing that code, we were able to resolve our issue with it!

Good to know that the timestamp should be in seconds; it would be helpful to update the documentation with that. And it’s also worth noting that milliseconds is required for signature generation for the Web SDK ([https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature](https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature)), which makes it inconsistent with the timestamp format for JWT generation for mobile SDKs.

It turns out the main issue I had was around this part of the docs:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/d/ddd8be2d4ae6737bd6eface9714aebaf89aca9d4.png)

Based on your sample code, it looks like ^ isn’t needed?

Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![yosuke.sawamura](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/yosuke.sawamura/32/1484_2.png) [@yosuke.sawamura](https://devforum.zoom.us/u/yosuke.sawamura)\
**Post date:** [June 25, 2020, 2:17am UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/8 "2020-06-25T02:17:33Z")

</div>

Hi abiyani,

Glad to hear you had it working.

Please understand that WebSDK signature has different purpose and requirement and not the same with SDK\_JWTTOKEN, this is for initialization.  
The HMACSHA256 signature is to define how to encode values, so in my sample its already defined.

Regards

---

<div class="post-metadata">

**Author:** ![yosuke.sawamura](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/yosuke.sawamura/32/1484_2.png) [@yosuke.sawamura](https://devforum.zoom.us/u/yosuke.sawamura)\
**Post date:** [June 25, 2020, 2:18am UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/9 "2020-06-25T02:18:56Z")

</div>



---

<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, 10:26pm UTC](https://devforum.zoom.us/t/cannot-initialize-zoom-sdk-error-code-3-internal-errorcode-124/22081/10 "2020-08-21T22:26:50Z")

</div>


