Invalid Parameter, error code: 4003

{type: ‘JOIN_MEETING_FAILED’, reason: ‘Invalid Parameter’, errorCode: 4003}:

I am working on next js 13 and using zoom sdk for my app requirements . I am getting this error when a user of my app is trying to join the meeting. Let me show you my code.

Code :

"use client"

import ZoomMtgEmbedded from '@zoomus/websdk/embedded';

import React, { useEffect } from "react";
const KJUR = require("jsrsasign");

interface IParams {
    meetingId: string;
}

const page = ({ params }: { params: IParams }) => {

    const { meetingId } = params;

    useEffect(() => {
        let client: any;

        const initializeMeeting = async () => {
            try {
                const ZoomEmbed = (await import('@zoomus/websdk/embedded')).default;
                client = ZoomMtgEmbedded.createClient();
                const meetingSDKElement = document.getElementById('meetingSDKElement');
                client.init({
                    language: 'en-US',
                    zoomAppRoot: meetingSDKElement ? meetingSDKElement : undefined,
                });
                const iat = Math.round(new Date().getTime() / 1000) - 30;
                const exp = iat + 60 * 60 * 2;

                const Header = {
                    alg: "HS256",
                    type: "JWT",
                };

                const payload = {
                    sdkKey: process.env.NEXT_PUBLIC_SDK_KEY,
                    mn: +meetingId,
                    role: 1,
                    iat: iat,
                    exp: exp,
                };

                const sHeader = JSON.stringify(Header);
                const sPayload = JSON.stringify(payload);

                const meetingSignature = await KJUR.KJUR.jws.JWS.sign(
                    "HS256",
                    sHeader,
                    sPayload,
                    process.env.NEXT_PUBLIC_SDK_SECRET
                );

                client.join({
                    sdkKey: process.env.NEXT_PUBLIC_SDK_KEY,
                    signature: meetingSignature,
                    meetingNumber: +meetingId,
                    userName: 'Ravi gupta',
                    userEmail: 'ravi2611gupta@gmail.com',
                    password: `804939`,
                    tk: ''
                });
            } catch (error) {
                console.log('--- Error inside useEffect ---> ', error);
            }
        };

        initializeMeeting();

        return () => {
            if (client) {
                console.log(client);
            }
        };
    }, []);


    return <div id='meetingSDKElement' className='w-full h-full p-32 bg-red-200'>

    </div>
}

export default page

Hi @ravi.gupta ,

is it possible that the quotes for password are invalid?

password: `804939`
1 Like

Hello, @chunsiong.zoom ,
Thanks for your reply, but I have tried this before. I have been send the password as string and numeric from both, but issues didn’t resolved.

are you able to share your JWT token? an expired one is fine

1 Like

Sure,

eyJhbGciOiJIUzI1NiIsInR5cGUiOiJKV1QifQ.eyJzZGtLZXkiOiJKR1pEdmZoNlNleTdZam03d2ltVzlnIiwibW4iOjg5MTQzNzE3Nzk2LCJyb2xlIjoxLCJpYXQiOi0xNjg2MjkxNjk4LCJleHAiOi0xNjg2MjkxNjM4fQ.qVTXZyDlyM5HqHXyFjo6aggLpLCVJ32qcBTV9gIBYeo

you can checked your signature on https://jwt.io/

result payload

{
  "sdkKey": "JGZDvfh6Sey7Yjm7wimW9g",
  "mn": 89143717796,
  "role": 1,
  "iat": -1686291698,
  "exp": -1686291638
}

iat and exp of your signature is negative and tokenExp is missing

more infos for troubleshooting

1 Like

@ravi.gupta , your IAT and EXP are in negative value. you need them to be after EPOCH time

and yes @j.schoenemeyer mentioned your tokenExp is missing too

1 Like

@chunsiong.zoom I’ve made it negative for generate a expired token. but after after adding tokenExp, the error is still the same

is there any additional error in the console log?

@chunsiong.zoom no.

Hey @chunsiong.zoom can we connect somewhere can you please review my code? It is really very urgent that’s why I’m asking you.

you use React 18 ?

meeting SDK uses React v16.13.0 and is - as far as I know - not compatible to React 17/18

but client view is working properly.

@ravi.gupta ,

could you refer to this, and check if the existing JWT works with this code sample?

For client view, you will need to use react 16

in your screenshot there is a React 18 warning message “ReactDOM.render is no longer supported in React 18 …”

if you are running React 18, the meeting SDK cannot run anymore

React 16 is not compatible with React 17 or React 18

:pray: So, please tell me what’s the solution of this problem. because it is really very urgent for me.

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