Unable to join meeting in react sdk ZoomMtgEmbedded

I have exhausted all efforts to join the meeting, encountering a persistent error in the console. Despite a month of troubleshooting, I remain stuck in resolving this issue. My seniors are growing increasingly dissatisfied with the lack of progress. The problem persists both on localhost and the live server, leaving me in a critical situation.

Your urgent attention and assistance in addressing this matter would be highly appreciated.

I have include component , jwt signature, error ,zoom version

I am using "@zoomus/websdk": "^2.17.0",

{type: 'JOIN_MEETING_FAILED', reason: 'Invalid Parameter', errorCode: 4003}
errorCode
: 
4003
reason
: 
"Invalid Parameter"
type
: 
"JOIN_MEETING_FAILED"
[[Prototype]]
: 
Object

here is the jwt signature

redacted

and here is the full component that I am implemented


import * as React from 'react';
import ZoomMtgEmbedded from '@zoomus/websdk/embedded';

const modalBg = {
    width: '100%',
    height: '100%',
    background: '#121212',
    position: 'absolute',
    zIndex: '9999',
  top: '50%',
  left: '50%',
  transform: 'translate(-50%, -50%)',

}
const style = {
    position: 'absolute',
    zIndex: '9999',
  top: '50%',
  left: '50%',
  transform: 'translate(-50%, -50%)',
  width: '100%',
  height: '100%' ,
  bgcolor: 'black',
  border: '1px solid #e1e1e1',
  borderRadius: '10px',
  boxShadow: 24,
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center',
  p: 4,
};
const joinMeet = {
  background: '#1BA9A0',
  color: '#fff',
  padding: '6px 20px',
  border: '0px',
  fontSize: '14px',
  borderRadius: '8px',
  '&:hover': {
    background: '#39c3ba'
  }
}
const closeModal = {
  position: 'absolute',
  top: '20px',
  right: '20px',
  cursor: 'pointer',
  zIndex: '999'

}

export default function ZoomPopup({zoomData, onClose}) {
  const [open, setOpen] = React.useState(false);
  // let userData = Cookies.get("loginData")? JSON.parse(Cookies.get("loginData")):null


  const client = ZoomMtgEmbedded.createClient();
  
  console.log(client,"client")  
  var authEndpoint = `${process.env.REACT_APP_BASE_URL}/api/v1/zoom/authEndpoint`
     var sdkKey = `${process.env.ZOOM_MEETING_SDK_KEY}`
     var meetingNumber = zoomData.id
     var passWord = zoomData.password
     var role = 0
     var userName = ''
     var userEmail = ''
     var registrantToken = ''  
     var zakToken = ''
    
     function getSignature() {
      
      fetch(authEndpoint, {
       method: 'POST',
       headers: { 'Content-Type': 'application/json' },
       body: JSON.stringify({
        meetingNumber: meetingNumber,
        role: role
       })
      }).then(res => res.json())
      .then(response => {
       startMeeting(response.Data)
       console.log(response,"aaaaaaaaaa")
      }).catch(error => {
       console.error(error,"AAAAAA")
      })
     }
    
     function startMeeting(signature, zoomData) {
    
      let meetingSDKElement = document.getElementById('meetingSDKElement');
    
      client.init({
       debug: true,
       zoomAppRoot: meetingSDKElement,
       language: 'en-US',
       customize: {
        meetingInfo: ['topic', 'host', 'mn', 'pwd', 'telPwd', 'invite', 'participant', 'dc', 'enctype'],
        toolbar: {
         buttons: [
          {
           text: 'Custom Button',
           className: 'CustomButton',
           onClick: () => {
            console.log('custom button');
           }
          }
         ]
        }
       }
      });
    
      client.join({
       signature: signature,
       sdkKey: sdkKey,
       meetingNumber: meetingNumber,
       password: passWord,
       userName: userName,
       userEmail: userEmail,
       tk: registrantToken,
       zak: zakToken
      })
     
    console.log(client.init,"meetingSDKElement")

   }

  return (
    <div>
      
      <div style={modalBg}>
        <div style={style}>
          <div style={closeModal} onClick={onClose}>
            <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path fillRule="evenodd" clipRule="evenodd" d="M11 1.75C5.89137 1.75 1.75 5.89137 1.75 11C1.75 16.1086 5.89137 20.25 11 20.25C16.1086 20.25 20.25 16.1086 20.25 11C20.25 5.89137 16.1086 1.75 11 1.75ZM0.25 11C0.25 5.06294 5.06294 0.25 11 0.25C16.9371 0.25 21.75 5.06294 21.75 11C21.75 16.9371 16.9371 21.75 11 21.75C5.06294 21.75 0.25 16.9371 0.25 11ZM7.46967 7.46967C7.76256 7.17678 8.23744 7.17678 8.53033 7.46967L11 9.93934L13.4697 7.46967C13.7626 7.17678 14.2374 7.17678 14.5303 7.46967C14.8232 7.76256 14.8232 8.23744 14.5303 8.53033L12.0607 11L14.5303 13.4697C14.8232 13.7626 14.8232 14.2374 14.5303 14.5303C14.2374 14.8232 13.7626 14.8232 13.4697 14.5303L11 12.0607L8.53033 14.5303C8.23744 14.8232 7.76256 14.8232 7.46967 14.5303C7.17678 14.2374 7.17678 13.7626 7.46967 13.4697L9.93934 11L7.46967 8.53033C7.17678 8.23744 7.17678 7.76256 7.46967 7.46967Z" fill="#f1c40f"/>
            </svg>
          </div>
        <div id="meetingSDKElement">
            {/* Zoom Meeting SDK Component View Rendered Here */}
        </div>
        <button style={joinMeet} onClick={getSignature}>Join Meeting</button>
        </div>
      </div>
        


    </div>
  );
}

Hi @ashishdwivediw
Thanks for reaching out to us, I am happy to assist you here.
It looks like your signature might be invalid.
Please take a look at this blog post on Troubleshooting the signature and look at the rules for its creation here:

Can you point out what is wrong with the signature? Upon reading the documentation, I believe my signature is correct. The iat is smaller than exp , and the sdkkey and appkey are the same. I am really struggling to find the problem.

Hi @ashishdwivediw
Sure thing so it looks like in your signature the exp value is the same than tokenExp and according to the troubleshooting guide, exp value should be greater than tokenExp.

I also wanted to share this sample app we have

Can you run it and see if you can join meetings?

@elisa.zoom there are 3 examples on the troubleshooting guide and all of them had equal exp value and tokenExp. Am I missing something?

I have implemented sdk from this only. :[

So you have not been able to run the sample app either? you get the same error?

Can you compare the signature you are generating with the one you can generate using this sample app please?

@elisa.zoom
I am using the same app code in my backend without any modifications. Additionally, if you observe, tokenExp: iat + 60 * 60 * 2 and const exp = iat + 60 * 60 * 2 yield identical values, so how can the exp value be greater? This is also evident in the provided sample. To address this, I modified it to const exp = iat + 60 * 60 * 4 , ensuring a greater value. However, despite this change, I am still unable to connect from the client side.

const authEndPointService = async (meetingNumber, role) => {
    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: `${process.env.ZOOM_MEETING_SDK_KEY}`,
          mn: meetingNumber,
          role: role,
          iat: iat,
          exp: exp,
          appKey: `${process.env.ZOOM_MEETING_SDK_KEY}`,
          tokenExp: iat + 60 * 60 * 2
         }
        
         const sHeader = JSON.stringify(oHeader)
         const sPayload = JSON.stringify(oPayload)
         const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, `${process.env.ZOOM_MEETING_SDK_SECRET}`)
        console.log('signatureeee',signature)
         return signature
        
    }
    catch(err){
        throw err
    }
};

What else should I look at?

@ashishdwivediw Interesting, I will send you a private message to ask for more details and I will take a closer look into this

Is this tracking Id :- https://rwcmb.cloud.zoom.us/wc/ping/82271380285?ts=1700565004711&auth=aN-6ipPLPRrRc1Ewk21tJ-D4r1vdVsFgSBYp1aqFvY8&rwcToken=DxxRwOpdRKxLpz22MUn_-o2RXLVetSDSbTt9midPKYs&dmz=1

Signature:-

Redacted

No, you can find the tracking id if you open the console in your browser, after you attempt to join meeting / start meeting

@elisa.zoom When I join meeting I get this only and nothing else.
Can You provide some Screenshot or example.

Uncaught (in promise)

 {type: 'JOIN_MEETING_FAILED', reason: 'Invalid Parameter', errorCode: 4003}

  1. errorCode: 4003
  2. reason: "Invalid Parameter"
  3. type: "JOIN_MEETING_FAILED"
  4. [[Prototype]]: Object

Hi @ashishdwivediw

Can you make sure to pass the role value 1 instead of 0 in your signature?

To start a Zoom meeting, you must use a role value of 1 in your SDK signature, and pass in the meeting host’s zak token. This enables the Meeting SDK for Web to start the meeting.

Another important question that I have not asked, what version of react you are working with. The client view only works with react 16 for now

I am currently utilizing React version “^18.2.0”. Despite changing my role to 1, the expected functionality did not occur, and I am still encountering the same error.

It surprises me that on my admin side where host starts the meeting and everything works despite having same react version and zoom code.

I did and here is the code ( got same error)

import * as React from 'react';
import ZoomMtgEmbedded from '@zoomus/websdk/embedded';

const modalBg = {
    width: '100%',
    height: '100%',
    background: '#121212',
    position: 'absolute',
    zIndex: '9999',
  top: '50%',
  left: '50%',
  transform: 'translate(-50%, -50%)',

}
const style = {
    position: 'absolute',
    zIndex: '9999',
  top: '50%',
  left: '50%',
  transform: 'translate(-50%, -50%)',
  width: '100%',
  height: '100%' ,
  bgcolor: 'black',
  border: '1px solid #e1e1e1',
  borderRadius: '10px',
  boxShadow: 24,
  display: 'flex',
  alignItems: 'center',
  justifyContent: 'center',
  p: 4,
};
const joinMeet = {
  background: '#1BA9A0',
  color: '#fff',
  padding: '6px 20px',
  border: '0px',
  fontSize: '14px',
  borderRadius: '8px',
  '&:hover': {
    background: '#39c3ba'
  }
}
const closeModal = {
  position: 'absolute',
  top: '20px',
  right: '20px',
  cursor: 'pointer',
  zIndex: '999'

}

const zoomData = {
  "uuid": "MvF7GTfNSRSv8RhXozfUsw==",
  "id": 82271380285,
  "host_id": "kJFctaH1QhGg30bbMxs84Q",
  "host_email": "ashishdwivediw@gmail.com",
  "topic": "My Meeting",
  "type": 2,
  "status": "waiting",
  "start_time": "2023-11-21T09:48:11Z",
  "duration": 60,
  "timezone": "America/Los_Angeles",
  "created_at": "2023-11-21T09:48:11Z",
  "start_url": "https://us05web.zoom.us/s/82271380285?zak=eyJ0eXAiOiJKV1QiLCJzdiI6IjAwMDAwMSIsInptX3NrbSI6InptX28ybSIsImFsZyI6IkhTMjU2In0.eyJhdWQiOiJjbGllbnRzbSIsInVpZCI6ImtKRmN0YUgxUWhHZzMwYmJNeHM4NFEiLCJpc3MiOiJ3ZWIiLCJzayI6IjAiLCJzdHkiOjEsIndjZCI6InVzMDUiLCJjbHQiOjAsIm1udW0iOiI4MjI3MTM4MDI4NSIsImV4cCI6MTcwMDU2NzI5MSwiaWF0IjoxNzAwNTYwMDkxLCJhaWQiOiJ6bU9HN1llZlFSU2daMzh0QTltbVlRIiwiY2lkIjoiIn0.YUbk0T4NjHsq0APmlQ1Cjs8cWFCI_y_pPEglFDIDdj8",
  "join_url": "https://us05web.zoom.us/j/82271380285?pwd=xw5or2MC2uuRORmycXsrJaGpVSwqa2.1",
  "password": "1GT7u5",
  "h323_password": "946061",
  "pstn_password": "946061",
  "encrypted_password": "xw5or2MC2uuRORmycXsrJaGpVSwqa2.1",
  "settings": {
    "host_video": false,
    "participant_video": false,
    "cn_meeting": false,
    "in_meeting": false,
    "join_before_host": false,
    "jbh_time": 0,
    "mute_upon_entry": false,
    "watermark": false,
    "use_pmi": false,
    "approval_type": 2,
    "audio": "voip",
    "auto_recording": "none",
    "enforce_login": false,
    "enforce_login_domains": "",
    "alternative_hosts": "",
    "alternative_host_update_polls": false,
    "close_registration": false,
    "show_share_button": false,
    "allow_multiple_devices": false,
    "registrants_confirmation_email": true,
    "waiting_room": true,
    "request_permission_to_unmute_participants": false,
    "registrants_email_notification": true,
    "meeting_authentication": false,
    "encryption_type": "enhanced_encryption",
    "approved_or_denied_countries_or_regions": {
      "enable": false
    },
    "breakout_room": {
      "enable": false
    },
    "internal_meeting": false,
    "continuous_meeting_chat": {
      "enable": false,
      "auto_add_invited_external_users": false
    },
    "participant_focused_meeting": false,
    "push_change_to_calendar": false,
    "resources": [],
    "alternative_hosts_email_notification": true,
    "show_join_info": false,
    "device_testing": false,
    "focus_mode": false,
    "enable_dedicated_group_chat": false,
    "private_meeting": false,
    "email_notification": true,
    "host_save_video_order": false,
    "sign_language_interpretation": {
      "enable": false
    },
    "email_in_attendee_report": false
  },
  "pre_schedule": false
}

export default function ZoomPopup() {


  const client = ZoomMtgEmbedded.createClient();
  
  console.log(client,"client")  
  var authEndpoint = `http://localhost:2000/api/v1/zoom/authEndpoint`
     var sdkKey = `redacted`
     var meetingNumber = zoomData.id
     var passWord = zoomData.password
     var role = 1
     var userName = ''
     var userEmail = ''
     var registrantToken = ''  
     var zakToken = ''
    
     function getSignature() {
      
      fetch(authEndpoint, {
       method: 'POST',
       headers: { 'Content-Type': 'application/json' },
       body: JSON.stringify({
        meetingNumber: meetingNumber,
        role: role
       })
      }).then(res => res.json())
      .then(response => {
       startMeeting(response.Data)
       console.log(response,"aaaaaaaaaa")
      }).catch(error => {
       console.error(error,"AAAAAA")
      })
     }
    
     function startMeeting(signature) {
    
      let meetingSDKElement = document.getElementById('meetingSDKElement');
    
      client.init({
       debug: true,
       zoomAppRoot: meetingSDKElement,
       language: 'en-US',
       customize: {
        meetingInfo: ['topic', 'host', 'mn', 'pwd', 'telPwd', 'invite', 'participant', 'dc', 'enctype'],
        toolbar: {
         buttons: [
          {
           text: 'Custom Button',
           className: 'CustomButton',
           onClick: () => {
            console.log('custom button');
           }
          }
         ]
        }
       }
      });
    
      client.join({
       signature: signature,
       sdkKey: sdkKey,
       meetingNumber: meetingNumber,
       password: passWord,
       userName: userName,
       userEmail: userEmail,
       tk: registrantToken,
       zak: zakToken
      })
     
    console.log(client.init,"meetingSDKElement")

   }

  return (
    <div>
      
      <div style={modalBg}>
        <div style={style}>
          <div style={closeModal} 
          // onClick={onClose}
          >
            <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path fillRule="evenodd" clipRule="evenodd" d="M11 1.75C5.89137 1.75 1.75 5.89137 1.75 11C1.75 16.1086 5.89137 20.25 11 20.25C16.1086 20.25 20.25 16.1086 20.25 11C20.25 5.89137 16.1086 1.75 11 1.75ZM0.25 11C0.25 5.06294 5.06294 0.25 11 0.25C16.9371 0.25 21.75 5.06294 21.75 11C21.75 16.9371 16.9371 21.75 11 21.75C5.06294 21.75 0.25 16.9371 0.25 11ZM7.46967 7.46967C7.76256 7.17678 8.23744 7.17678 8.53033 7.46967L11 9.93934L13.4697 7.46967C13.7626 7.17678 14.2374 7.17678 14.5303 7.46967C14.8232 7.76256 14.8232 8.23744 14.5303 8.53033L12.0607 11L14.5303 13.4697C14.8232 13.7626 14.8232 14.2374 14.5303 14.5303C14.2374 14.8232 13.7626 14.8232 13.4697 14.5303L11 12.0607L8.53033 14.5303C8.23744 14.8232 7.76256 14.8232 7.46967 14.5303C7.17678 14.2374 7.17678 13.7626 7.46967 13.4697L9.93934 11L7.46967 8.53033C7.17678 8.23744 7.17678 7.76256 7.46967 7.46967Z" fill="#f1c40f"/>
            </svg>
          </div>
        <div id="meetingSDKElement">
            {/* Zoom Meeting SDK Component View Rendered Here */}
        </div>
        <button style={joinMeet} onClick={getSignature}>Join Meeting</button>
        </div>
      </div>
        


    </div>
  );
}

any updates @elisa.zoom

Hi @ashishdwivediw
We are currently looking into this.
It looks like we are having some issues with the latest version of meeting SDK and react 18, have you tried downgrading to react 16 to see if this works?
We are also troubleshooting signature generation to see if this is an issue on our end
I will keep you posted

I am currently unable to downgrade the version. As a temporary measure until the issue is resolved, clients are joining using the Zoom app.

thanks for sharing that with me
I made it work but had to downgrade react to version 16 and pulled some dependencies via CDN,

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