Invalid Signature Issue While Initializing Meet

Hey there, we trying to use @zoomus/websdk in our patient app and facing invalid signature issue.

We’ve assured that the meeting number is correct. Attaching information related to that here:

Signature: QXpXbV9mQ2JTdUdGQkxvZmk3bEg4US45NjAzNTA3OTIwLjE2NDY5MDY0OTE0NTUuMC5INGQ5NEpjajRMUzlwNi9Gc3ZtRmJ1bjN2VnAzZG9ZT3pMNG85WUJPUGNjPQ==

Meeting Number: 96035xxxxx

Code used to generate is deployed on heroku with JWT key and secret and is same to this: GitHub - zoom/meetingsdk-sample-signature-node.js: Generate a signature to Start and Join Meetings and Webinars with the Zoom Web Meeting SDK.

Code on our end to initialize chat:

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

interface StartMeetingProps {
  signature: string | undefined;
  meetingNumber: string | undefined;
  username: string | undefined;
  password: string | undefined;
}

interface GetSignatureProps {
  event: any;
  meetingNumber: string | undefined;
  username: string | undefined;
  password: string | undefined;
}

const getSignature = (props: GetSignatureProps) => {
  const { event, meetingNumber, password, username } = props || {};
  event.preventDefault();

  fetch(process.env.REACT_APP_ZOOM_SIGNATURE_ENDPOINT!, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      meetingNumber: meetingNumber,
      role: 0
    })
  })
    .then((res) => res.json())
    .then((response) => {
      const meetingProps = {
        signature: response.signature,
        meetingNumber: meetingNumber,
        username: username,
        password: password
      };
      startMeeting(meetingProps);
    })
    .catch((error) => {
      console.error(error);
    });
};

const startMeeting = (props: StartMeetingProps) => {
  const rootElement: HTMLElement = document.getElementById(
    'ZoomEmbeddedApp'
  ) as HTMLElement;
  const { signature, meetingNumber, username, password } = props || {};

  // get meeting args from url
  const meetingConfig = {
    apiKey: process.env.REACT_APP_ZOOM_SIGNATURE_ENDPOINT,
    meetingNumber: meetingNumber,
    userName: username,
    password: password,
    leaveUrl: '/home',
    role: 0,
    userEmail: '',
    lang: 'en-US',
    signature: signature || '',
    webEndpoint: 'zoom.us'
  };

  if (!meetingConfig.signature) {
    console.log('no signature found');
  } else {
    const zmClient = ZoomMtgEmbedded.createClient();

    const tmpPort =
      window.location.port === '' ? '' : ':' + window.location.port;
    const avLibUrl =
      window.location.protocol +
      '//' +
      window.location.hostname +
      tmpPort +
      '/lib';

    zmClient
      .init({
        debug: true,
        zoomAppRoot: rootElement,
        assetPath: avLibUrl,
        language: meetingConfig.lang
      })
      .then((e: any) => {
        console.log('init success', e);
      })
      .catch((e: any) => {
        console.log('init error', e);
      });

    console.log(signature, meetingNumber);
    // WebSDK Embedded join
    zmClient
      .join({
        apiKey: meetingConfig.apiKey || '',
        signature: meetingConfig.signature,
        meetingNumber: meetingConfig.meetingNumber || '',
        userName: meetingConfig.userName || '',
        password: meetingConfig.password,
        userEmail: meetingConfig.userEmail
      })
      .then((e: any) => {
        console.log('join success', e);
      })
      .catch((e: any) => {
        console.log('join error', e);
      });
  }
};

export { getSignature };

Hi @yourphysio ,

I see your Signature is encoded.
In comparison to the response from the sample signature node, the signature should not be encoded.

The samples response from GitHub - zoom/meetingsdk-sample-signature-node.js: Generate a signature to Start and Join Meetings and Webinars with the Zoom Meeting SDKs. gives you something like

{
  "signature": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJhYmMxMjMiLCJtbiI6IjEyMzQ1Njc4OSIsInJvbGUiOjAsImlhdCI6MTY0NjkzNzU1MywiZXhwIjoxNjQ2OTQ0NzUzLCJhcHBLZXkiOiJhYmMxMjMiLCJ0b2tlbkV4cCI6MTY0Njk0NDc1M30.UcWxbWY-y22wFarBBc9i3lGQuZAsuUpl8GRR8wUah2M"
}

If you look at the signature closely, it should follow the format of `

{
"signature":"aaaaaaaaa.bbbbbbbbbbbb.ccccccccccccccc"
}

There are 3 portion of the string, with . as delimiter.

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