Unable to Authenticate with JWT in Zoom C# SDK v5

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, 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).

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

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

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.

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

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

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

    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!

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!

1 Like