I’m trying to join a meeting using Meeting Web SDK.
What I’m actually doing:
I’m creating a JS class ZoomClient:
const zoomClient = new ZoomClient({
mode: 'recv-streams',
username: 'sample',
email: 'sample@sample.eu',
meetingUri: zoomUri,
sdkKey: clientId, // Zoom's General App Client ID
sdkSecret: clientSecret, // Zoom's General App Client Secret
htmlElementId: 'zoom-root',
);
and as you can see I’m passing it my Zoom’s General App Client ID and Secret:
(since February 11, 2023 Client ID and Secret are used instead of SDK Key and SDK Secret)
After that I’m generating a JWT signature using this Client ID and Secret:
const signature = signZoomJoin(meetingNumber, 0, sdkKey, sdkSecret);
export function signZoomJoin(meetingNumber: string, role: 0 | 1, sdkKey: string, sdkSecret: string): string {
const iat = Math.round(Date.now() / 1000);
const exp = iat + 60 * 60 * 2;
const oHeader = { alg: 'HS256', typ: 'JWT' };
const oPayload = {
sdkKey: sdkKey,
appKey: sdkKey,
mn: meetingNumber,
role: role,
iat: iat,
exp: exp,
tokenExp: iat + 60 * 60 * 2,
};
const sHeader = JSON.stringify(oHeader);
const sPayload = JSON.stringify(oPayload);
return KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret);
}
(code literally copy pasted from this official GitHub example)
After that I’m creating a zoomClient:
this.client = ZoomMtgEmbedded.createClient();
And then I’m trying to join a Zoom Meeting using that generated JWT signature:
await this.client.join({
signature, // previously generated signature
meetingNumber: meetingNumber,
userName: username,
sdkKey,
password: password,
});
This join meeting part breaks and returns an error message 200 ‘Fail to join meeting.’:
I followed exact steps on how to do this, and it’s failing.
What am I doing wrong?
Please help