Receiving AUTHRET_NONE after authentication, the authentication callbacks are never being called

Format Your New Topic as Follows:

Meeting SDK Type and Version
Linux Meeting SDK v5.16.1

Description
I am developing an application that runs inside a Docker container using Ubuntu 22.04 as the base image. The app is designed to join online calls and capture both video and audio data. I’ve successfully integrated the Zoom Linux Meeting SDK, initialized it, and authenticated it. In fact, when I invoke the SDKAuth method, it returns ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS . However, when I attempt to verify the authentication state by calling GetAuthResult() , I get AUTHRET_NONE. What’s concerning is that the callback I’ve set up (OnAuthenticationComplete), never gets triggered.

Error?
SDK is not authenticated yet. Code: 7

How To Reproduce

  1. Initialize Zoom SDK:
ZOOM_SDK_NAMESPACE::InitParam initParam;
        initParam.strWebDomain = "https://zoom.us";
        initParam.strSupportUrl = "https://zoom.us";
        initParam.emLanguageID = ZOOM_SDK_NAMESPACE::LANGUAGE_English;
        initParam.enableLogByDefault = true;
        initParam.enableGenerateDump = true;
        auto err = ZOOM_SDK_NAMESPACE::InitSDK(initParam);
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) {
            std::cerr << "Error: Unable to initialize Zoom SDK: " << err << std::endl;
            return false;
        }
        std::cout << "Zoom SDK initialized" << std::endl;
  1. Authenticate SDK:
 ZOOMSDK::SDKError err(ZOOMSDK::SDKError::SDKERR_SUCCESS);

        ZOOM_SDK_NAMESPACE::CreateAuthService(&m_pAuthService);
        if (!m_pAuthService) {
            std::cerr << "Error: Unable to create authentication service." << std::endl;
            return nullptr;
        }
        ZOOM_SDK_NAMESPACE::AuthContext param;
        param.jwt_token = token.c_str();

        if ((err = m_pAuthService->SetEvent(new AuthServiceEventListener(&OnAuthenticationComplete))) !=
            ZOOMSDK::SDKError::SDKERR_SUCCESS) {};
        std::cout << "AuthServiceEventListener added." << std::endl;
        err = m_pAuthService->SDKAuth(param);
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) { // I am getting ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS here
            std::cerr << "Error: Unable to authenticate Zoom SDK: " << err << std::endl;
            return nullptr;
        } else {
            std::cout << "Zoom SDK authenticated" << std::endl;
        }
        auto authResult = m_pAuthService->GetAuthResult();
        cout << "Auth result: " << authResult << endl;
        return m_pAuthService;
  1. Try to join a meeting:
                    // Check if SDK is authenticated
                    ZoomSdk *zoomSdk = &ZoomSdk::GetInstance();
                    ZOOM_SDK_NAMESPACE::IAuthService *authService = zoomSdk->GetAuthService();
                    auto authResult = authService->GetAuthResult(); // I am getting ZOOM_SDK_NAMESPACE::AUTHRET_NONE
                    if (authResult != ZOOM_SDK_NAMESPACE::AUTHRET_SUCCESS) {
                        CROW_LOG_WARNING << "SDK is not authenticated yet. Code: " << authResult; // Output: SDK is not authenticated yet. Code: 7
                        return crow::response(crow::status::SERVICE_UNAVAILABLE);
                    }
                    auto reqJson = crow::json::load(req.body);
                    if (!reqJson) {
                        CROW_LOG_WARNING << "Invalid request data: " << req.body;
                        return crow::response(crow::status::BAD_REQUEST);

                    }
[... the rest of code is removed...]

@chunsiong.zoom please take a look.

@alextsi

I’ve taken a look at the code. Calling GetAuthResult() that early, or immediately after calling err = m_pAuthService->SDKAuth(param); is almost likely to always return AuthRet_None, as the roundtrip for SDK authentication has just started and has not completed yet.

Did you try on a local Ubuntu Machine or Ubuntu VM? I’m thinking if there are some dependencies which you might be missing during the docker build process.

I’ve just tried 5.16.1 on Ubuntu 22 docker container, and it appears to be working fine.

Here’s what I’m using for my docker build dependencies, please note that they are not optimized for space, and I’m using additional libraries for some other scenarios.

# Use the official Ubuntu image as the base image
FROM ubuntu:22.04

# Install necessary dependencies
RUN apt-get update && \
    apt-get install -y build-essential cmake

RUN apt-get install -y pkgconf

RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
    libx11-xcb1 \
    libxcb-xfixes0 \
    libxcb-shape0 \
    libxcb-shm0 \
    libxcb-randr0 \
    libxcb-image0 \
    libxcb-keysyms1 \
    libxcb-xtest0 \
    libdbus-1-3 \
    libglib2.0-0 \
    libgbm1 \
    libxfixes3 \
    libgl1 \
    libdrm2 \
    libgssapi-krb5-2 \
    openssl \
    ca-certificates \
    pkg-config \
    libegl-mesa0 \
    libsdl2-dev \
    g++-multilib 
# Install CURL related libs
RUN apt-get install -y libcurl4-openssl-dev

# Install ALSA
RUN apt-get install -y libasound2 libasound2-plugins alsa alsa-utils alsa-oss

# Install Pulseaudio
RUN apt-get install -y  pulseaudio pulseaudio-utils

# INSTALL FFMPEG
RUN apt-get install -y libavformat-dev libavfilter-dev libavdevice-dev ffmpeg

Thanks @chunsiong.zoom, I appreciate your prompt answer!
I had the same list of packages in Dockerfile except ALSA, Pulseaudio, and FFMPEG. It is unlikely these should be the causing this, however, I added them and re-built the container, got the same result.

Here is my full Dockerfile:

FROM ubuntu:22.04

RUN DEBIAN_FRONTEND="noninteractive"

RUN apt-get update \
  && apt-get install -y ssh \
    build-essential \
    gcc \
    g++ \
    gdb \
    clang \
    make \
    cmake \
    ninja-build \
    autoconf \
    automake \
    locales-all \
    dos2unix \
    rsync \
    tar \
    pkgconf \
    curl \
    zip  \
    unzip \
    git \
    python3 \
    python3-pip \
    gtkmm-3.0 \
  && apt-get clean

# Zoom Dependencies
# https://developers.zoom.us/docs/meeting-sdk/linux/get-started/download/
RUN apt-get install -y --no-install-recommends --no-install-suggests \
  libx11-xcb1 \
  libxcb-xfixes0 \
  libxcb-shape0 \
  libxcb-shm0 \
  libxcb-randr0 \
  libxcb-image0 \
  libxcb-keysyms1 \
  libxcb-xtest0 \
  libdbus-1-3 \
  libglib2.0-0 \
  libgbm1 \
  libxfixes3 \
  libgl1 \
  libdrm2 \
  libgssapi-krb5-2 \
  openssl \
  ca-certificates \
  pkg-config \
  libegl-mesa0 \
  libsdl2-dev \
  g++-multilib \
  && apt-get clean

# Dependencies manager set up
RUN pip3 install conan
WORKDIR /conan_project
COPY conanfile.txt .
RUN conan profile detect --force
## Install dependencies
RUN conan install . --build=missing
COPY debug.conf .
RUN conan install . --build=missing -pr ./debug.conf

# Install CURL related libs
RUN apt-get install -y libcurl4-openssl-dev

# Install ALSA
RUN apt-get install -y libasound2 libasound2-plugins alsa alsa-utils alsa-oss

# Install Pulseaudio
RUN apt-get install -y  pulseaudio pulseaudio-utils

# INSTALL FFMPEG
RUN apt-get install -y libavformat-dev libavfilter-dev libavdevice-dev ffmpeg

RUN useradd -m app \
  && yes password | passwd app

RUN usermod -s /bin/bash app

COPY . /home/app/zoom-bot
# Zoom SDK needs this symlink
WORKDIR /home/app/zoom-bot
RUN ln -s libmeetingsdk.so libmeetingsdk.so.1
# Copy the secrets file and build the project
WORKDIR /home/app/build
COPY ./secrets /home/app/secrets
RUN bash -c "cmake ../zoom-bot -DCMAKE_BUILD_TYPE=Release && cmake --build ."
CMD ["./zoom-bot"]

I agree. Just to test if GetAuthResult() returns something else over time, I added this code to my Auth() function:

    ZOOM_SDK_NAMESPACE::IAuthService *ZoomSdk::Auth(const string &token) {
        ZOOMSDK::SDKError err(ZOOMSDK::SDKError::SDKERR_SUCCESS);

        ZOOM_SDK_NAMESPACE::CreateAuthService(&m_pAuthService);
        if (!m_pAuthService) {
            std::cerr << "Error: Unable to create authentication service." << std::endl;
            return nullptr;
        }
        ZOOM_SDK_NAMESPACE::AuthContext param;
        param.jwt_token = token.c_str();

        if ((err = m_pAuthService->SetEvent(new AuthServiceEventListener(&OnAuthenticationComplete))) !=
            ZOOMSDK::SDKError::SDKERR_SUCCESS) {};
        std::cout << "AuthServiceEventListener added." << std::endl;
        err = m_pAuthService->SDKAuth(param);
        if (err != ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS) { // I am getting ZOOM_SDK_NAMESPACE::SDKERR_SUCCESS here
            std::cerr << "Error: Unable to authenticate Zoom SDK: " << err << std::endl;
            return nullptr;
        } else {
            std::cout << "Zoom SDK authenticated" << std::endl;
        }
        // ##### Added this code ########
        while (true) {
            std::this_thread::sleep_for(std::chrono::seconds(1));
            auto authResult = m_pAuthService->GetAuthResult();
            cout << "Auth result: " << authResult << endl;
        }
        // ##########################
        return m_pAuthService;
    }

It outputs the same code indefinitely:
Auth result: 7
Auth result: 7
Auth result: 7
Auth result: 7
Auth result: 7
Auth result: 7
Auth result: 7

Hi, fellow Zoom developers,

After reviewing the latest posts on the forum, I was able to resolve the issue when I came across this post: Linux Meeting SDK example

First, I got my Crow HTTP server running in a separate thread.

Secondly, I integrated a GMainLoop into my main.cpp code:

#include <glib.h>

void sigHandler(int s)
{
    cout << "Caught signal: " << s << endl;
    httpServer->Stop();
    exit(0);
}

int main() {
    /* ... */
    struct sigaction sigIntHandler{};
    sigIntHandler.sa_handler = sigHandler;
    sigemptyset(&sigIntHandler.sa_mask);
    sigIntHandler.sa_flags = 0;
    sigaction(SIGINT, &sigIntHandler, nullptr);

    GMainLoop* loop = g_main_loop_new(nullptr, FALSE);
    g_timeout_add(100, [](gpointer) -> gboolean {
        return TRUE;
    }, loop);
    g_main_loop_run(loop);
    return 0;
}

You will need to install the gtkmm-3.0 package and add it to your CMakeLists.txt along with glib-2.0 library.

1 Like