C++: Authorization issue. AUTHRET_NONE from authService->GetAuthResult, callback never invoked, can't login or join meetings

Description
I’m having trouble getting my application to authorize with the Zoom SDK. The JWT I’m using works fine with the demo, so I’m assuming the JWT isn’t the issue. I’ve tried to crawl through the demo to see exactly how it’s authorizing, but I do not appear to be doing anything different, though it’s hard to tell exactly what order things happen in the demo. The written instructions in the docs appear to be out-of-date.

Which Windows Client SDK version?
v5.4.54802.0124
Also tested on v5.5.12511.0422

To Reproduce(If applicable)
I’m running the following code:

ZOOMSDK::InitParam initParam;
initParam.strWebDomain = L"https://zoom.us";
if (ZOOMSDK::SDKERR_SUCCESS != ZOOMSDK::InitSDK(initParam)) {
    std::cout << "Init failed.\n";
    return 1;
}
ZOOMSDK::IAuthService* authService;
if (ZOOMSDK::SDKERR_SUCCESS != ZOOMSDK::CreateAuthService(&authService)) {
    std::cout << "Creating auth service failed.\n";
    return 2;
}
AuthEventHandler* authHandler = new AuthEventHandler();
if (authService->SetEvent(authHandler) != ZOOMSDK::SDKERR_SUCCESS) {
    std::cout << "SetEvent failed.\n";
    return 3;
}
ZOOMSDK::AuthContext param;
param.jwt_token = L"token"; // Edited out.
ZOOMSDK::SDKError ret = authService->SDKAuth(param);
if (ZOOMSDK::SDKERR_SUCCESS != ret) {
    std::cout << "SDKAuth failed.\n" << ret;
    return 4;
}
ZOOMSDK::AuthResult authResult = authService->GetAuthResult();
if (authResult != 0) {
    std::cout << "AuthResult: " << authResult; // 7 here.
    return 5;
}

As it’s unclear whether SDKAuth should be synchronous or asynchronous, I’ve tried waiting for a call to my callback function (onAuthenticationReturn in the AuthEventHandler above) but it’s never invoked, tried waiting until GetAuthResult() returns something other than a 7 (it never does), and tried using non-JWT auth (which causes the same issue). I’ve passed it an invalid JWT token just to make sure it catches it and it correctly gives a different error code (15). I tried ignoring this and moving on because it does initially give a return of 0, but login gives an error 8 (SDKERR_UNAUTHORIZED) and joining a meeting as a without-login user gives the same error. I briefly messed around with using a NetworkConnectionHelper and NetworkConnectionHandler to see if that would help, but I’m not sure whether that should be necessary and it didn’t seem to fix the issue.

Can anyone help clear up what’s going on here? Since it’s working in the demo, I must be missing something, but I’ve been looking around for quite a few hours and haven’t found it yet.

Device (please complete the following information):

  • Device: Laptop w/ i7-8750H, 16GB RAM
  • OS: Windows 10

I fixed the issue. The solution was the same as this one:

Even when creating a SDK application without any UI, this appears to still be necessary to ensure that the SDK calls the callback functions.

This issue also happens with the C# wrapper if you don’t have a UI for your app. I’m unsure how you would resolve this when using the C# wrapper.

Hey @Zulunko,

Awesome! I am glad you got that one resolved :slight_smile:
Please let us know if you have any other questions.

Thanks!
Michael

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