Questions regarding ZAK & Meeting SDK call flow & errors

Description
I’m fairly new to OAuth as well as Zoom dev. I’m trying to add a feature to an existing native desktop app that’ll allow users to launch zoom meetings. Thus far, I’m able to obtain an access token via OAuth and obtain a ZAK for user_id=me. But I’m unable to launch a meeting because getMeetingService() returns nil. Additionally, isAuthorized() returns ‘3’ (failure). I’d really appreciate help figuring out why.

Following the sample code, after obtaining both an access token and a zak, I initialize the meeting sdk:

    ZoomSDKInitParams* params = [[ZoomSDKInitParams alloc] init];
    params.needCustomizedUI = NO;
    params.teamIdentifier = nil;
    
    [[ZoomSDK sharedSDK] initSDKWithParams:params];
    [[ZoomSDK sharedSDK] setZoomDomain:[NSString stringWithStdString:kDomain]];

    params = nil;

Then I attempt to access the meeting service:

        auto sharedSDK = [ZoomSDK sharedSDK];

        auto authService = [sharedSDK getAuthService]; //debug
       BOOL isAuth = [authService isAuthorized];  //debug
        
        auto meetingService = [sharedSDK getMeetingService];
        if (isAuth && meetingService)
        {
            ZoomSDKStartMeetingUseZakElements *params = [[ZoomSDKStartMeetingUseZakElements alloc] init];
            params.zak = _mZAK;
            params.userType = SDKUserType_APIUser;
            params.userId = @"me";
            params.displayName = @"Tester";
            params.meetingNumber = 0;
            params.isDirectShare = NO;
            params.displayID = 0;
            params.isNoVideo = NO;
            params.isNoAuido = NO;
            params.vanityID = nil;
            ZoomSDKError ret = [meetingService startMeetingWithZAK:params];
        }

Also, is the userType as well as all the param settings correct? (I’ve found any docs explaining user types very confusing)

Additionally, I’m very confused about the call flow, which I currently understand to be:

  1. Use OAuth to obtain an access token and zak for the user
  2. Init the SDK
  3. Get an instance of the meeting service
  4. Pass the zak to the meeting service to start a meeting on behalf of the user

Is this correct or am I missing steps? If this is correct, can you help me figure out why it doesn’t work for me?

And finally, even more confusing is the seemingly conflicting documentation:

According to the following page, I should be using JWT’s to authenticate the app:

But then this page displays a diagram which suggests all I have to do is what I’ve already done - authenticate the user via pkce /oauth, obtain a zak for the user, and I should be able to launch a meeting:

In fact, the client secret is encoded and appended to the access token request, which I understood meant I didn’t have to generate a JWT to send that info to zoom servers.

Also on that page(Supporting OAuth in your SDK app), the directions on requesting an access token conflict with the instructions on this page:Authentication and the api reference.

Can you please point me to the definitive and correct docs? The comments in the header files are useful for reference but are not at all instructive (and are sometimes also confusing) due to their brevity.

Which macOS Meeting SDK version?
SDK Version: 5.9.6 (5014)
MacOS version: 10.15.7

Device (please complete the following information):
Macbook Pro

Additional context
Because I searched this forum before posting:

  • I did double check my project settings - all frameworks, dylibs, etc are being copied to the frameworks dir in the final product.
  • I’m using domain ‘zoom.us
  • ZAK obtained via endpoint “https://api.zoom.us/v2/users/me/zak

Thanks in advance for any help.

Hi @blain,

Based on the information you’ve provided, it doesn’t seem like you are authorizing the SDK with your SDK credentials. To do this, you can call sdkAuth and then check the onZoomSDKAuthReturn callback to determine whether or not it was successful. This process is completely independent of the OAuth credentials you used to obtain an access token and ZAK, and cannot be done with OAuth credentials.

OAuth is used to authenticated the Zoom users joining meetings through your app, and SDK auth is used to verify your developer account. So if you are going to be joining or starting a meeting as an authenticated user through the SDK, both types of auth are required.

Thanks!

Hi Jon,

Thanks for the quick response :slightly_smiling_face:

Just to be clear, I’d like users to be able to launch zoom meetings from the app, not just join. And also invite other users to their meeting. Does your answer still apply in this case?

Also, in order to check the onZoomSDKAuthReturn callback, the caller would have to conform to the ZoomSDKAuthDelegate protocol and set itself as the ZoomSDKAuthService delegate, correct?

Wouldn’t calling isAuthorized or checking the return value of sdkAuth achieve the same thing?

Thanks!

Hi @blain,

Just to be clear, I’d like users to be able to launch zoom meetings from the app, not just join. And also invite other users to their meeting. Does your answer still apply in this case?

Yes, this applies to both starting and joining meetings.

Also, in order to check the onZoomSDKAuthReturn callback, the caller would have to conform to the ZoomSDKAuthDelegate protocol and set itself as the ZoomSDKAuthService delegate, correct?

It seems that you have a correct understanding of what this flow looks like. :slightly_smiling_face:

Wouldn’t calling isAuthorized or checking the return value of sdkAuth achieve the same thing?

When you use your developer credentials via sdkAuth, it involves asynchronous operations since the SDK needs to talk with our back end to validate your credentials. So the return value of the sdkAuth method just indicates whether or not the SDK will start this process. The onZoomSDKAuthReturn callback is triggered when the SDK gets a response from our servers.

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.