# Unable to Authenticate with JWT in Zoom C# SDK v5

**URL:** <https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710>\
**Category:** Windows\
**Created:** [September 29, 2020, 9:30pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710 "2020-09-29T21:30:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![async](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@async](https://devforum.zoom.us/u/async)\
**Post date:** [September 29, 2020, 9:30pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/1 "2020-09-29T21:30:45Z")

</div>

**Description**  
JWT-based authentication in the SDK is not working for me.

I have been working with v4 of the SDK and authenticating as an SDK user successfully. Today I upgraded to V5, read the notes at [https://github.com/zoom/zoom-sdk-windows/blob/master/CHANGELOG.md](https://github.com/zoom/zoom-sdk-windows/blob/master/CHANGELOG.md), and tried using the demo app with no changes (zoom\_sdk\_demo.exe). When I paste my JWT in (verified it is a valid JWT) ZOOM\_SDK\_DOTNET\_WRAP.CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(param) returns 15, which might be SDKERR\_INTELNAL\_ERROR ([https://zoom.github.io/zoom-sdk-windows/zoom\_\_sdk\_\_def\_8h.html#aea74527af3b9f22cf00d38080c896036a9f2ad73cc1eea19ba231ded78cb3f002](https://zoom.github.io/zoom-sdk-windows/zoom __sdk__ def_8h.html#aea74527af3b9f22cf00d38080c896036a9f2ad73cc1eea19ba231ded78cb3f002)).

**Which version?**  
I am using the latest version of the SDK and C# wrapper: v5.0.24433.0616 (git tag)

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

1. Clone the c# wrapper repo
2. Run, paste in JWT generated in the app market place
3. App does not join a meeting, SDKAuth returns 15 (non success code). I tried this with 2 different JWT apps

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

- Device Spec: PC
- OS: Windows 10
- Version 19041.508

---

<div class="post-metadata">

**Author:** ![umar](https://avatars.discourse-cdn.com/v4/letter/u/59ef9b/32.png) [@umar](https://devforum.zoom.us/u/umar)\
**Post date:** [September 29, 2020, 10:56pm UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/2 "2020-09-29T22:56:21Z")

</div>

Hello @async  
was having the same problem,  
but resolved it with the following modification  
` ZOOM_SDK_DOTNET_WRAP.AuthParam authParam = new ZOOM_SDK_DOTNET_WRAP.AuthParam(); authParam.appKey = HashManager.GetApiKey(); authParam.appSecret = HashManager.GetApiSecret(); ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetAuthServiceWrap().SDKAuth(authParam);`

Instead of using AuthContext I used AuthParam and passed the appKey and appSecret then it worked fine, replace HashManager.GetXXX() with your real values

---

<div class="post-metadata">

**Author:** ![async](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@async](https://devforum.zoom.us/u/async)\
**Post date:** [September 30, 2020, 12:15am UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/3 "2020-09-30T00:15:57Z")

</div>

Thanks @umar, you are great. That allowed me to use my SDK credentials to join a meeting again and worked.

Any Zoom engineers/PMs: This means JWT join does not work; it would be good to document the SDK way of things working in the sample possibly with the JWT method.

---

<div class="post-metadata">

**Author:** ![subeesh.n](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@subeesh.n](https://devforum.zoom.us/u/subeesh.n)\
**Post date:** [October 23, 2020, 3:32am UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/4 "2020-10-23T03:32:11Z")

</div>

Hello @async  
Can you please help me to know how to join a meeting using c# wrapper?  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [October 24, 2020, 7:26am UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/5 "2020-10-24T07:26:56Z")

</div>

Hi @async,

Thanks for the post and pardon the late response. The JWT token that the SDK is expecting is a JWT token that is generated by SDK key & secret. The JWT token on the Marketplace is for the Zoom API. You may find the instruction here: [https://github.com/zoom/zoom-c-sharp-wrapper#initializing-sdk-with-jwt-token](https://github.com/zoom/zoom-c-sharp-wrapper#initializing-sdk-with-jwt-token)

Here is a handy Python script that could be helpful in generating the JWT token:

```auto
    iat = long(int(time.time()))
    exp = long((datetime.datetime.today() + datetime.timedelta(days=2)).strftime("%s"))
    tokenExp = long((datetime.datetime.today() + datetime.timedelta(hours=1)).strftime("%s"))

    payload = {
        'appKey': key,
        'iat': iat,
        'exp': exp,
        'tokenExp': tokenExp
    }
    encoded = jwt.encode(payload, secret, algorithm='HS256')

```

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [October 24, 2020, 7:31am UTC](https://devforum.zoom.us/t/unable-to-authenticate-with-jwt-in-zoom-c-sdk-v5/31710/6 "2020-10-24T07:31:06Z")

</div>

Hi @subeesh.n,

Thanks for the reply. After you have passed the JWT token authentication(as mentioned above), enter the meeting number and the display name, and then press the join meeting button to join a meeting.

Hope this helps. Thanks!
