Got error SDKERR_UNAUTHENTICATION when call JoinMeeting as end user

I am getting error SDKERR_UNAUTHENTICATION when trying to join meeting as withoutLoginUser.

Which Desktop Client SDK version?
zoom-sdk-windows-5.5.12511.0422

  1. Init SDK and auth. This step works fine with no errors
    ZOOMSDK::SDKError CMeetingService::InitSDK(ZOOMSDK::InitParam& param)
    {
    ZOOM_SDK_NAMESPACE::SDKError err = SDKInterfaceWrap::GetInst().Init(param);
    if (ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS != err)
    {
    //todo: do more UI work
    }
    else
    {
    //todo: do more network connection work
    if (SDKInterfaceWrap::GetInst().GetNetworkConnectionHelper())
    {
    // SDKInterfaceWrap::GetInst().GetNetworkConnectionHelper()->RegisterNetworkConnectionHandler(this);
    }
    }

    if (m_pAuthService == NULL)
    {
    m_pAuthService = SDKInterfaceWrap::GetInst().GetAuthService();
    SDKInterfaceWrap::GetInst().ListenAuthServiceEvent(this);
    }

    if(m_pAuthService)
    {
    std::wstring strToken = L"…";

     ZOOM_SDK_NAMESPACE::AuthContext param;
     param.jwt_token = strToken.c_str();
     
     **err = m_pAuthService->SDKAuth(param);**
    

    }

    return err;
    }

  2. Attempting to join meeting:

     if (m_pAuthService)
     {		
     	if (IsMeetingServiceReady())
     	{
     		ZOOMSDK::MeetingStatus status = m_pMeetingService->GetMeetingStatus();
     		
     		/*some configurations about the meeting should be called here*/
     		if (m_pMeetingService->GetMeetingConfiguration())
     		{
     			m_pMeetingService->GetMeetingConfiguration()->SetSharingToolbarVisibility(true);
     		}
     		ZOOM_SDK_NAMESPACE::ISettingService* pSettingService = SDKInterfaceWrap::GetInst().GetSettingService();
     		if (pSettingService)
     		{
     			ZOOM_SDK_NAMESPACE::IAudioSettingContext* pAudioContext = pSettingService->GetAudioSettings();
     			if (pAudioContext)
     			{
     				pAudioContext->EnableAutoJoinAudio(true);
     			}
     		}
     		ZOOM_SDK_NAMESPACE::SDKError err = ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS;
     		**err = m_pMeetingService->Join(paramJoinMeeting);**
     		return err;
     	}
     }
    
     return ZOOM_SDK_NAMESPACE::SDKERR_UNINITIALIZE;
    

On the line: m_pMeetingService->Join(paramJoinMeeting); I am getting SDKERR_UNAUTHENTICATION error which is unexpected as far as on previous step authorization was made.

Hey @AlexRaiev,

Thanks for using the dev forum! You must wait for the onAuthReturn event to be triggered before attempting to join a meeting. Right now there is a race condition between authing the SDK and calling joinMeeting.

Thanks!
Michael

Thank you Michael for your reply. This moment was unclear from SDK documentation which seems to be slightly outdated.
So, could you provide more details or example regarding this event handling, since I can’t find any mention of it in SDK Demo App. Probably you mean onAuthenticationReturn, correct?

I found a few topics here related to problems with no triggering onAuthenticationReturn event which is similar to my case.
but I also noticed that it happen in console or C# wrapper type apps. In my case, I am building win32 application C++ MFC. Does it make any sense and help to resolve this issue?

Hey @AlexRaiev,

This is true, we are in the process of updating our docs.

Yes, onAuthenticationReturn is what I meant. My mistake it is called onAuthReturn in the iOS SDK :slight_smile:

As long as your application is set up to receive Windows API messages, the events should trigger properly. Applications like Console Applications need additional work because they do not handle Windows messages by default. If your application is successfully receiving messages but your onAuthenticationReturn callback is not firing, it is likely the the SDK was not given a valid JWT, or the SDK was not initialized properly.

The first thing I would do to troubleshoot further is to pass in your SDK key and secret into the auth parameters instead of the JWT. Do not do this in practice, but only for troubleshooting. To do this, replace your tagAuthContext with a ZOOM Windows SDK: tagAuthParam Struct Reference.

Thanks!
Michael

Thank you for your help.
I am already tried to use AppKey+SecretKey with the same result.
I generate JWT token by using jwt.io/#debugger and this token works fine in demo app.
So, the problem is definitely in my code which is based on demo application code but without using duilib. So, I am still not sure how to find what is causing this error.

Hey @AlexRaiev,

Can you send a small sandboxed version of your application to me at DeveloperSupport@zoom.us? Please omit any personal data and mention this post in the email.

Thanks!
Michael