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