Building Secure Zoom Video SDK Web Sessions with Server-Side Authentication

Building Secure Zoom Video SDK Web Sessions with Server-Side Authentication

Building a custom video experience is more than just connecting users to a session. Developers must also ensure that only authorized users can join and that participants receive the appropriate permissions.

The Zoom Video SDK enables developers to integrate video, audio, screen sharing, and other real-time communication features directly into web applications.

But how do you securely authenticate users and control their roles?

Let’s explore how to implement server-side authentication using Node.js and manage participant permissions with the Zoom Video SDK.

1. Understanding Zoom Video SDK Authentication

Unlike traditional Zoom Meetings, the Zoom Video SDK allows developers to create fully customized video experiences within their own applications.

To start or join a Video SDK session, users need a JSON Web Token (JWT) generated using their application’s Video SDK credentials.

The JWT contains essential information, including:

  • app_key: Your Zoom Video SDK key.
  • tpc: The session name.
  • role_type: Determines whether the user is a host or participant.
  • iat: Token issuance time.
  • exp: Token expiration time.

Important: JWTs should always be generated on a secure backend. Exposing the Video SDK Secret in frontend code creates a serious security risk.

2. Generating a Video SDK JWT with Node.js

Let’s look at a simple Node.js implementation using the jsonwebtoken library.

First, install the dependency:

Terminal
npm install jsonwebtoken

Next, create a function that generates a JWT:

JavaScript
import jwt from 'jsonwebtoken';

function generateToken(sessionName, isHost) {
  const now = Math.floor(Date.now() / 1000);

  const payload = {
    app_key: process.env.ZOOM_VIDEO_SDK_KEY,
    tpc: sessionName,
    role_type: isHost ? 1 : 0,
    version: 1,
    iat: now,
    exp: now + 3600
  };

  return jwt.sign(
    payload,
    process.env.ZOOM_VIDEO_SDK_SECRET,
    { algorithm: 'HS256' }
  );
}

This function creates a JWT valid for one hour.

The isHost value must be determined by your backend after authenticating the user and checking their permissions, rather than trusting a value submitted by the browser.

In a production application, expose this function through a protected API endpoint that verifies the user’s identity and session membership before returning the token.

3. Joining a Session from the Frontend

Once the backend generates the token, the web application can use it to join a session.

Install the Zoom Video SDK:

Terminal
npm install @zoom/videosdk

Initialize the SDK and connect:

JavaScript
import ZoomVideo from '@zoom/videosdk';

const client = ZoomVideo.createClient();

await client.init('en-US', 'Global', {
  patchJsMedia: true
});

// Token returned by your authenticated backend
await client.join(
  'TeamSession',
  token,
  'John Doe',
  'sessionPasscode'
);

The session name must match the tpc value inside the JWT. A session passcode is optional, but must match if the session uses one.

After joining, developers can implement features such as video streaming, audio controls, and participant management.

4. Managing Participant Roles

The Zoom Video SDK supports different permission levels through its role system.

Role JWT Value Capabilities
Host role_type: 1 Can start and manage sessions, remove participants, and assign management privileges.
Participant role_type: 0 Can join and participate in sessions with limited administrative privileges.

A session host can also assign manager (co-host) privileges to other participants.

For example, in a virtual coaching application, coaches may receive host privileges while members join as participants.

This allows developers to create controlled experiences without giving every participant administrative access.

5. Security Best Practices

Before deploying your integration, consider these essential security measures:

  • Protect credentials: Store Video SDK credentials in secure environment variables or a secrets manager.
  • Validate permissions: Confirm that users are authorized to access a session before issuing a JWT.
  • Use limited token lifetimes: Generate tokens with appropriate expiration times.
  • Handle failures: Display meaningful messages for expired tokens, incorrect passcodes, or unauthorized access.
  • Test role restrictions: Verify that ordinary participants cannot perform host-only actions.

A secure implementation should also use HTTPS, authenticate its token endpoint, and avoid logging sensitive JWTs.

6. Building Secure Video Experiences with Codimite

Secure authentication and participant management are essential foundations for reliable, scalable video applications.

With 6+ years of Zoom expertise, access to specialized Zoom APIs, and direct collaboration with Zoom developers, Codimite helps businesses build custom Zoom-powered solutions tailored to their requirements.

Whether you’re developing a virtual coaching platform, customer engagement solution, or embedded video application, the right authentication architecture is a critical first step.

Looking to build a custom video experience with Zoom? Connect with Codimite to explore your integration requirements.

We value your privacy

Codimite uses essential cookies to keep our website secure and functional. With your consent, we also use analytics and marketing cookies to improve your experience and understand website usage.

You can accept all cookies, reject all cookies, or manage your preferences. Learn more in our Privacy Policy.

We use cookies to understand how our website is used. You can or . See our Privacy Policy.