Error 13023 AUTHRET_KEYORSECRETWRONG

Description
App encounters error #13023, AUTHRET_KEYORSECRETWRONG

Which version?
version 5.2.1 (42037.1112)

Screenshots
Zoom SDK initialized (version 5.2.1 (42037.1112))
Created AuthService successfully
Set authorization service event handler successfully
Registered network connection helper successfully
INetworkConnectionHelper: proxy detect complete
Using JWT authorization
Set app authorization successfully
onAuthenticationReturn: 2 Key or secret wrong
Last Zoom error: 1 13023 “”

Additional context
Windows 10 (20H2 Build 19042.630)
Qt 5.10, MinGW C++ / MSVC++ Visual Studio 2019

Web domain for testing is: https://zoom.us
App key and secret are taken from my app’s “App Credentials” page on the Zoom Marketplace.

  1. sdk_demo_v2 is compiled and running properly on my computer.
  2. I run my own app, it generates a JWT on the fly and calls SDKAuth(AuthContext) with the JWT set. The authorization service returns 2 (AUTHRET_KEYORSECRETWRONG) and IZoomLastError::GetErrorCode returns 13023.
  3. I copy the JWT from my app and paste it into sdk_demo_v2 (on the same computer, in the same directory, with the same Zoom SDK DLLs), click the “Auth” button, and authorization proceeds successfully and the login page is displayed.

So: I know the JWT is valid and accepted for authorization. But, the same JWT in my app always ends in error 13023. I assume that app is doing something wrong during the handshake, or not doing something that is required.

Why does the same JWT work for sdk_demo_v2 but not for my app? This is the puzzling question.

Any suggestions would be appreciated.

Hey @drpclind

Thanks for using the dev forum!

That is very strange that the JWT works in the demo app but not your own. Just for troubleshooting purposes can you try providing your SDK Key and Secret into the SDK instead of the JWT?

To do this:
Change AuthContext to AuthParam and hardcode the credentials into appKey and appSecret.
Let me know how this change effects both your own application and sdk_demo_v2.

Thanks!
Michael

Hello Michael, and thanks for the help.

This one really has me stumped. I have tried numerous things to overcome this, but nothing has worked so far.

I should emphasize that I am using Qt 5.10 and MinGW 32-bit as my development environment. My app compiles fine, and runs reasonably well. I am calling InitSDK, creating the AuthService, registering the IAuthServiceEvent handler, created the connection helper and connection handler, etc. I have made great effort to follow the steps in sdk_demo_v2.

As I reported, the JWT that I generate fails to authorize in my app, but the same JWT works perfectly well in sdk_demo_v2. I can’t figure out what I am doing wrong (or not doing) in my app.

I have re-generated the App Secret several times, and even created a second account with a second App Key and Secret, but still I get the same error (AUTHRET_KEYORSECRETWRONG).

At this point, I am officially stumped.

Following your suggestion, I recoded sdk_demo_v2 to use AuthParam instead of AuthContext, and it seems to work properly – the demo displays the login page, which means that authorization was successful. But, when I try the same in my app, the call to AuthSDK returns an error code of 15 (SDKERR_INTELNAL_ERROR). For test purposes, I stripped the code down to the bare minimum, but still it fails:

   ZOOM_SDK_NAMESPACE::AuthParam authParam;
   authParam.appKey = L"xxxx";
   authParam.appSecret = L"xxxx";
   rc = pAuthService->SDKAuth(authParam);

So, I’m not sure what to try next.

Thanks for the help.

Hey @drpclind,

Hmm that is very strange. At what point in the SDK’s lifecycle are you calling SDKAuth? I am curious if a race condition exists between initializing the SDK and Authorizing it.

Also, you are using the key and secret from the SDK tile of Zoom Marketplace and not the JWT tile correct?

Thanks!
Michael

Yes, I believe that I am using the App Key and Secret from the SDK section:

image

image

And, I am following the workflow diagram from the online documentation “API User Join/Start and Leave Meeting Sequence” (link).

Here is the debug log from my app:

2020/12/03 12:59:31.110 : 1. Calling InitSDK(initParam)
2020/12/03 12:59:32.336 : Zoom SDK initialized (version 5.2.1 (42037.1112))
2020/12/03 12:59:32.337 : 2. Calling CreateNetworkConnectionHelper()
2020/12/03 12:59:32.337 : Created network connection helper successfully
2020/12/03 12:59:32.338 : 3. Calling INetworkConnectionHelper::RegisterNetworkConnectionHandler()
2020/12/03 12:59:32.338 : Registered network connection helper successfully
2020/12/03 12:59:32.338 : 4. Calling CreateAuthService()
2020/12/03 12:59:32.339 : Created AuthService successfully
2020/12/03 12:59:32.340 : 5. Calling IAuthService::SetEvent()
2020/12/03 12:59:32.340 : Set authorization service event handler successfully
2020/12/03 12:59:32.481 : TINetworkConnectionHelper: proxy detect complete
2020/12/03 12:59:38.291 : Using JWT authorization
2020/12/03 12:59:38.291 : 6. Calling IAuthService::SDKAuth(AuthContext)
2020/12/03 12:59:38.318 : Called SDKAuth successfully
2020/12/03 12:59:39.618 : onAuthenticationReturn: 2 Key or secret wrong
2020/12/03 12:59:39.619 : ZoomLastError: Type=1, ErrorCode=13023, ErrorDescription=

My current theory is that the Zoom SDK is not co-existing well with Qt framework, and perhaps Qt’s message handling loop is disrupting the normal operation of the Zoom SDK.

When I run the Zoom sdk_demo_v2 program and use my App Key/Secret (calling SDKAuth(AuthParam)), or when I use my JWT token pasted into sdk_demo_v2 (and calling SDKAuth(AuthContext)), the authorization is successful, and I am able to complete the login. So, this is the part that confuses me; I can’t understand why my credentials work in the Zoom demo app, but not in my own app. (And, the only glaring difference is that my app is using Qt instead of MS Visual C++.)

Thanks again for the help.

Hey @drpclind,

Hmm this is indeed confusing. Would you be able to provide your VSSolution in an email to developersupport.zoom.us so that I can take a look? A small sample application with the same issue would also work. Please mention my name and provide a link to this dev forum post.

Thanks!
Michael

My app is not a VSSolution, so I can’t provide such. I am writing my app in C++ using the Qt 5 framework. I doubt it would help much for me to send you that project, but I am willing to send it if you are able to work with that system. (I doubt you have a Qt development environment set up, but I could be wrong.)

I have been adapting the sdk_demo_v2 example code, and have been trying various theories, but so far have not found any clues.

I am wondering about a possible problem with SSL. How does the Zoom Desktop SDK handle the private key and public certificate for SSL handshaking? Maybe the sdk_demo_v2 app is supplying the proper SSL keys (internal to the VS solution)? If this is the case, then maybe my app is missing this information and the SSL is failing.

Other than that hypothesis, I will continue to work away on it, and if I find a way to resolve the problem, I will post an update.

Thanks for the help.

Hey @drpclind,

I see; my mistake, you had already mentioned you were using QT :man_facepalming:t2: To cover all of the bases, you aren’t authorizing the SDK in multiple instances simultaneously? As in, you aren’t trying to authorize the SDK in your own application while it is currently authorized in the demo application?

Beyond that, I am also curious if it is QT.

Thanks!
Michael

Hey @drpclind
Thanks for your feedback. we have many customers using our SDK via QT, Don’t worry about this.
When you reproduce this issue, could you please exit app normally, go to the Dir %appdata%/ZoomSDK/logs, zip the all logger files and send to us for troubleshooting?
BTW, if it is ok for you, could you please share the code snippets using our SDK Auth interface?
Regards
Dats

Hello dats,

Thanks for the help.

I tried to send my sample app and logs via the email indicated by Michael Condon, but the link did not work properly; the link resulted in an error message “This site can’t be reached. developersupport.zoom.us’s server IP address could not be found.”.

I have my sample app packaged and ready to send to you, but need to know a working method for sending it.

Thanks,

Peter

Hey @drpclind,

My mistake, it should be developersupport@zoom.us

Thanks!
Michael

Hi Michael and Dats,

I have sent an email to the indicated address.

Thanks very much for the help.

Peter

Hi @drpclind,
Thanks for your support. After debug your app, I think we found the root cause. This caused by the different mechanisms for generating c++ virtual tables between MinGW and Visual studio.
more details as following,


here is the two IAuthService’s SDK auth vitual function offset in your ZoomTest.exe binary(using MinGW).
the offset of virtual SDKError SDKAuth(AuthParam& authParam) = 0; is 4
and the offset of virtual SDKError SDKAuth(AuthContext& authContext) = 0; is 8

but in our binary(using Visual studio)
the offset of virtual SDKError SDKAuth(AuthParam& authParam) = 0; is 8
and the offset of virtual SDKError SDKAuth(AuthContext& authContext) = 0; is 4

Could you help to change to QT+MSVC compiler and linker to retry this case?
I am very sorry about that, in the previous chat, I forgot about the MinGW factor.
Regards
Dats

Hi Dats,

That is something I had not realized is possible, but it does make sense.

Yes, I will try Qt with MSVC instead of MinGW and see how that affects things.

Thanks!

Update:

Your report that the virtual table for the SDK was being messed up under MinGW was a real revelation for me. I’m quite shocked that such a thing could happen. It is likely I would never have discovered that problem on my own.

From your breakdown of the log file, it is clear that under MinGW, the two SDKAuth functions were getting swapped in the vtable under MinGW.

So, I did a quick test by recasting the parameter of the function call. Instead of

rc = pAuthService->SDKAuth(AuthContext);

I tried this

rc = pAuthService->SDKAuth(*((ZOOM_SDK_NAMESPACE::AuthParam *) &AuthContext));

As soon as I ran the app, it worked properly: the authorization was successful and I was able to login to Zoom.

So, this problem is essentially solved. Although I detest having to recast parameters to fool the compiler in this way, I now know what the underlying problem is. My next step is to try to fix this problem in a better way, by finding a workaround that eliminates the parameter recasting. (Unfortunately, I am committed to MinGW, and won’t be switching to MSVC, so I will need to find a solution that allows me to continue using MinGW.)

Thanks very much for the help.

Peter

Another update:

I also found that I could fix the vtable problem by swapping positions of the two declarations of SDKAuth() in the header file (auth_service_interface.h).

hi @drpclind
I’m so glad to hear that the problem has been solved via the workaround solution.
We will also continue to look for better solutions. let’s keep update with each other.
Thank you very much
Dats