# Host user sometimes joins as participant randomly in Web SDK

**URL:** <https://devforum.zoom.us/t/host-user-sometimes-joins-as-participant-randomly-in-web-sdk/136541>\
**Category:** Web\
**Created:** [August 15, 2025, 3:15pm UTC](https://devforum.zoom.us/t/host-user-sometimes-joins-as-participant-randomly-in-web-sdk/136541 "2025-08-15T15:15:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeKer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/teker/32/72895_2.png) [@TeKer](https://devforum.zoom.us/u/TeKer)\
**Post date:** [August 15, 2025, 3:15pm UTC](https://devforum.zoom.us/t/host-user-sometimes-joins-as-participant-randomly-in-web-sdk/136541/1 "2025-08-15T15:15:16Z")

</div>

Hi,

I’m using the Zoom Web SDK to join/start meetings and I’m seeing a strange behavior where a user who should be the host sometimes joins as a participant instead — and it happens randomly.  
(zoom/meetingsdk: “^3.13.2”)

According to the docs:

> `role`: `0` specifies participant, `1` specifies host.

Here’s an example of the data I send before generating the JWT token:

```javascript
{
  meetingNumber: "12132526369",
  role: 0,
  zoomPassword: "1234",
  userName: "John Doe",
  userEmail: "john.doe@example.com"
}

{
  meetingNumber: "12132526369",
  role: 1,
  zoomPassword: "1234",
  userName: "Dr. Smith",
  userEmail: "dr.smith@example.com"
}

```

This data is passed to my Zoom auth route to generate the JWT token exactly as the docs describe.

**Zoom Auth Route:**

```javascript
try {
    const iat = Math.round(new Date().getTime() / 1000) - 30;
    const exp = iat + 60 * 60 * 2;

    const oHeader = { alg: "HS256", typ: "JWT" };

    const oPayload = {
      sdkKey: clientId,
      appKey: clientId,
      mn: meetingNumber,
      role: role,
      iat: iat,
      exp: exp,
      tokenExp: iat + 60 * 60 * 2,
    };

    console.log(oPayload, "oPayload");

    const sHeader = JSON.stringify(oHeader);
    const sPayload = JSON.stringify(oPayload);
    const signature = KJUR.jws.JWS.sign(
      "HS256",
      sHeader,
      sPayload,
      clientSecret
    );

    return NextResponse.json({
      signature,
    });
} catch (err) {
    return NextResponse.json({ err });
}

```

With the generated JWT, the meeting is joined via:

**content.js** (simplified snippet):

```javascript
const startMeeting = () => {
    document.getElementById("zmmtg-root").style.display = "block";

    setLoading(false);

    ZoomMtg.init({
        leaveUrl: currentDomainData.origin,
        patchJsMedia: true,
        success: (success) => {
            console.log(success);

            ZoomMtg.join({
                signature,
                sdkKey,
                meetingNumber,
                passWord,
                userName,
                userEmail,
                tk: "",
                zak: "",
                success: (success) => {
                    console.log(success);
                },
                error: (error) => {
                    console.log(error);
                },
            });
        },
        error: (error) => {
            console.log(error);
        },
    });
};

```

The implementation works most of the time, but randomly, the user that should be the host (role `1`) joins as a participant instead.

Has anyone seen this before or knows what might cause Zoom to ignore the `role: 1` in the JWT payload? Could it be related to ZAK tokens, meeting state, or host already being in the meeting?

Thanks in advance.

---

<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:** [August 15, 2026, 3:15pm UTC](https://devforum.zoom.us/t/host-user-sometimes-joins-as-participant-randomly-in-web-sdk/136541/2 "2026-08-15T15:15:53Z")

</div>

Closed on August 15, 2026, 3:15pm UTC

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