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

**URL:** <https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792>\
**Category:** Windows\
**Created:** [May 22, 2021, 12:46am UTC](https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792 "2021-05-22T00:46:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zulunko](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/zulunko/32/27398_2.png) [@Zulunko](https://devforum.zoom.us/u/Zulunko)\
**Post date:** [May 22, 2021, 12:46am UTC](https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792/1 "2021-05-22T00:46:52Z")

</div>

**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](https://marketplace.zoom.us/docs/sdk/native-sdks/windows/mastering-sdk/windows-sdk-functions) 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

---

<div class="post-metadata">

**Author:** ![Zulunko](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/zulunko/32/27398_2.png) [@Zulunko](https://devforum.zoom.us/u/Zulunko)\
**Post date:** [May 23, 2021, 11:52pm UTC](https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792/2 "2021-05-23T23:52:39Z")

</div>

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

> [@joinSession Event callbacks are not fired](https://devforum.zoom.us/t/joinsession-event-callbacks-are-not-fired/43426):
>
> Description Using Fully customizable Windows SDK, not getting callback events of joinSession even though joinSession returns Success but not getting onSessionJoin callback. Error Error: Send error, 10051 Unknown error Error: Send error, 10051 Unknown error Error: Send error, 10051 Unknown error Which version? zoom-instant-sdk-windows-1.0.1 To Reproduce Steps to reproduce the behavior: Create console application on Windows(in Visual Studio 2017) using the Fully Customizable SDK Follow [h…](https://marketplace.zoom.us/docs/sdk/custom/windows/essential/initialize)

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.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [May 24, 2021, 7:20pm UTC](https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792/3 "2021-05-24T19:20:49Z")

</div>

Hey @Zulunko,

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

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 24, 2021, 5:21am UTC](https://devforum.zoom.us/t/c-authorization-issue-authret-none-from-authservice-getauthresult-callback-never-invoked-cant-login-or-join-meetings/50792/4 "2021-06-24T05:21:32Z")

</div>

Closed on June 24, 2021, 5:21am UTC

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