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 };