aminwafi98
(Muhamad Amin Wafi)
April 5, 2023, 5:10am
1
Hi,
I had actually integrated the Meeting SDK with my Angular application. I followed the code from this link: GitHub - zoom/meetingsdk-angular-sample: Use the Zoom Meeting SDK in Angular , which states that it is required to set up the authEndpoint. Therefore, I set up the authEndpoint using Express and NodeJs. However, whenever I tried to join the meeting, it pop up ‘Fail to join the meeting’. Kindly appreciate any assistance on what parameter is missing or invalid.
Browser console error:
{type: ‘JOIN_MEETING_FAILED’, reason: ‘Invalid Parameter’, errorCode: 4003}
Code Snippets Angular:
getSignature() {
this.httpClient.post(this.authEndpoint, {
meetingNumber: this.meetingNumber,
role: this.role
}).toPromise().then((data: any) => {
if (data.signature) {
console.log(data.signature);
this.startMeeting(data.signature);
} else {
console.log(data);
}
}).catch((error) => {
console.log(error);
});
}
startMeeting(signature) {
this.client.join({
signature: signature,
sdkKey: this.sdkKey,
meetingNumber: this.meetingNumber,
password: this.passWord,
userName: this.userName
})
}
Code Snippet Node JS:
app.post(‘/zoom/signature’, (req, res) => {
const iat = Math.round(new Date().getTime() / 1000) - 30;
const exp = iat + 60 * 60 * 2;
const oHeader = { alg: ‘HS256’, type: ‘JWT’ };
const oPayload = {
sdkKey: config.ZOOM.MEETING_SDK_KEY,
mn: req.body.meetingNumber,
role: req.body.role,
iat: iat,
exp: exp,
appKey: config.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, config.ZOOM.MEETING_SDK_SECRET);
console.log(signature);
res.json({
signature: signature
});
});
chunsiong.zoom
(Chun Siong (tag me for response))
April 5, 2023, 7:14am
2
are you able to share your JWT token here? An expired one will do fine as well.
aminwafi98
(Muhamad Amin Wafi)
April 8, 2023, 9:48am
3
Hi, does anyone have solution to this, Im still stuck on this issue
check your created signature here
and perhaps have a look into this thread → first try the CDN example and if this works go forward
aminwafi98
(Muhamad Amin Wafi)
April 8, 2023, 12:47pm
5
I have checked my jwt signature from jwt.io , it seems to me that the payload and header is already correct. Here is my signature:
[REDACTED]
I have also tried the local cdn method, however upon joining the meeting, it pops up this error:
Thanks for helping btw
did you create your Meeting SDK App after Feb 11, 2023 ?
if yes - use " Client ID" & “Client Secret”
if no - use “SDK Key” &" SDK Secret"
have this issue been resolved? because I am getting same error can someone please help me in this. Please let me show you my code.
I am using next.js 13.2.4 and typescript
"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
@ravi.gupta ,
Sorry for not getting back to you sooner. Is this still an issue for you? Please let me know if you have any questions.