Upgrading to OAuth in C++ Windows SDK Application - starting the demo application

Hi
A couple of years ago I wrote a C++ Windows application with JWT style login using the Zoom SDK which has proved very successful and indeed is now crucial to our company. But is has stopped working, I think because of the SDK upgrade requirements. So I am trying to upgrade it to the latest version of the SDK, v 5.11.4.7235, and to use OAuth authorisation.
I worked out how to do it last time by reverse engineering the demo application that comes with the SDK. But this time I cannot even get the demo app to start. It compiles fine, but it asks you to provide an ‘sdk jwt token’ which I thought was the old way of doing things which is about to be made redundant.
So my initial questions are:

Is the demo app an OAuth app at all?
If it isn’t, is there an C++ Windows SDK demo app that uses OAuth available?
If it is, what is a ‘sdk jwt token’ and how does it relate to OAuth?

In parallel I have successfully followed the OAuth documentation and developed fresh C++ code that happily obtains and renews Access Tokens from the Zoom server - all I have to do now is work out how to use the things! I have tried using the lovely new authorisation codes and access tokens as the ‘sdk jwt token’ in the demo app - no luck - the authorisation fails. Similarly I have tried every every code/token I can retrieve from the app market place for my account and application - no luck.

Any help/pointers would be appreciated. If I could get the demo app working, I can bang my head against it until I work out and/or copy what it does.

Thanks

Mike

Okay - so I have now worked out that the example app is a JWT type app, not an OAUTH app.

So now I can go to my freshly created active JWT app, copy the JWT token from there, paste it into the user interface for the demo app and watch it fail in exactly the same way! I will try this a few more times.

Given that we are not supposed to be creating JWT apps, as they are about to be retired, and I have already done the work to get a valid OAuth access token, my questions then become:

1 What do I do with the OAuth access token in a C++ SDK App?
2 is there an example C++ SDK OAuth app we can download and copy?

Thanks

Mike

Hi Mike,

We don’t have a C++ example for the SDK, but you should read about the Server-to-Server OAuth to get an understanding of the architecture. This would require making HTTP calls from your C++ app to authenticate and make requests from the Zoom API. You can do this using any number of http clients or using the standard lib

Hi Shariq

Thanks for the response, although I admit it leaves no less confused.

The application I wrote is a replacement for the standard Zoom windows client that allows our staff to view multiple shared screens simultaneously which is essential to their work. The code makes frequent use of calls such as CreateShareRender to add new users to the client when they join a meeting. I was surprised, therefore, that you suggest I look at the Server to Server architecture. Surely our application is a client rather than another server.

However, I don’t pretend I understand the ways you classify apps now. If I follow the Server to Server architecture, how do I access calls to functions such as CreateShareRende?. Is there HTTP level endpoint that offers such low-level functionality? If there is, can you point me to the spec as I haven’t managed to find it yet.

If the Server to Server route is the correct one to follow, can you also please explain what happens when the access token expires one hour and five minutes into a meeting? Will our app stop working?

Many thanks

Mike

@mikehcam,

You can get started with Windows C++ SDK with the following steps:

  1. The Zoom Meeting SDKs use an SDK Key and Secret to generate an SDK JWT for authorized use of the SDK. To get an SDK Key and Secret, you will need to build an SDK app in Zoom Marketplace. Be sure to save SDK Key and Secret because you need them later on to generate SDK JWT.

Create an SDK app:

  1. If you haven’t already, you will need to download the window SDK from the Marketplace:

Download the window SDK

  1. Launch Visual Studio, and locate the sdk_demo.vcproj file, and open it.

  2. Right-click on the project in the solution panel and changed the Configuration and Platform to Active Release and x64. (or “x86” if you are running the x86 version)

  1. Then, build the SDK. Once the demo application has been built, the first screen will ask you to enter Web Domain , the default domain is https://zoom.us :

image

  1. Then, you will need to authenticate the SDK with an encrypted SDK JSON Web Token (JWT) to start and join a Zoom meeting or webinar. Use the SDK Key and Secret credentials from Step 1 to generate the JWT SDK token , you can find the instruction here :

Generate the SDK JWT

The Header includes the specification of the signing algorithm and the type of token.

Header:

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

The payload of a JWT contains the claims of the token, or the pieces of information being passed about the user and any metadata required.

Payload:

{
  "appKey": SDK_KEY,
  "iat": 1646937553,
  "exp": 1646944753,
  "tokenExp": 1646944753
}

Example SDK JWT:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJhYmMxMjMiLCJtbiI6IjEyMzQ1Njc4OSIsInJvbGUiOjAsImlhdCI6MTY0NjkzNzU1MywiZXhwIjoxNjQ2OTQ0NzUzLCJhcHBLZXkiOiJhYmMxMjMiLCJ0b2tlbkV4cCI6MTY0Njk0NDc1M30.UcWxbWY-y22wFarBBc9i3lGQuZAsuUpl8GRR8wUah2M

Enter SDK JWT token Window

The window where you will be asked to enter your SDK JWT token looks like this:

image

  1. To join a meeting navigate to the “Only Join” tab and provide the relevant meeting credentials.

Join a meeting

image

Hi

Thanks for that information. I am pleased to report that I have followed the guidance and my custom client can now connect again, and I can login. But the application is not working properly or in the manner it used to. So some more questions if I may.

By far the most important question is whether there is any limit in the Zoom server as to the maximum number of screen shares that can be rendered simultaneously in a custom sdk client. The purpose of my client is to allow our trainers to watch what the trainees are doing on their remote PC’s whilst training software over Zoom. The old version used to be able to render 10 or so remote screen shares simultaneously and it worked really well. But the updated client can only render two at a time.

Some more information. I am testing using four remote Zoom users/sessions on separate PCs all sharing a different local Windows application on their respective machines. Two of the remote shared applications render perfectly in my client but the other two display as black rectangles. I don’t think it’s a problem with the remote Zoom sessions as I can switch between the individual remote shares in the standard Zoom client, and they all display perfectly. Similarly, I don’t think it’s an issue in my client as the remote sessions can all share perfectly within it, but only two at a time. I can control which two work, by the order in which I start the remote sharing. The first pair to start sharing display perfectly, but the second pair appear to the client to be working fine but actually display as black rectangles. I can pick any two from the four, but only two. I don’t think it is a problem with the software as I never get any error messages, the renderers all appear to be created and running ok, any two of the four connections can work (but only in pairs), and it’s the same code that used to be able to render any number of shares. I have tried running the client on two different PC’s and the behaviour was identical on both (two work, two don’t).

So the obvious question, please, is whether you have introduced a limit in your server as to the maximum number of screen/window shares that can be rendered simultaneously in an custom sdk client. If you have, is there any way of raising it for an individual application? A limit of two is a disaster for the application and would be a major problem for us.

And I have three less important questions that your documentation/web site doesn’t currently answer.

To authorize my client, I have to create a JWT token using the SDK key and secret and send it to the server, and all is well. The type of my client is ‘ Meeting SDK’ although this first step requires the use of a JWT Token. Can you please confirm that despite the use of the token, my application is not a ‘JWT App’ that you will stop supporting in June next year, but a Meeting SDK client that will be okay beyond that date.

The sdk authorization I successfully receive lasts for 1 hour. Towards the end of this period I receive an ‘onZoomAuthIdentityExpired’ event. If I respond instantly by generating a new JWT token and requesting authorisation again, the re-authorisation fails. But if I try again a second later it works. Is this just a matter of your server not being ready because my new request is too quick? Is there a better way to do this?

Similarly, I can now use the OAUTH mechanism to login to Zoom. The Zoom access token I receive also lasts one hour. But in this case, my application never receives any corresponding ‘onZoomIdentityExpired’ event, and so I am using a timer to trigger refreshing the access token. This appears to be working fine, but again, is there a better way to do this?

Many thanks

Mike

I have another question which I may as well ask.

I am trying to use the onSharingContentStartRecving event in the ICustomizedShareRenderEvent Class but I never receive these events. I do receive the onSharingSourceUserIDNotification events defined in the same class, but not the onSharingContentStartRecving event.

Does anyone know if onSharingContentStartRecving works in the Windows Meeting SDK?