I’m getting the “Joining meeting timeout” error popup message in my Angular App where I have integrated Web SDK. When I monitored the request-response I could see “Invalid signature.” error message is returning from the url:
https://zoom.us/api/v1/wc/info?meetingNumbe…
I created a JWT App, copied API Key and API Secret, and used in the Java code to generate the signature. The following is the code I’m using to generate the code.
try {
Mac hasher = Mac.getInstance(“HmacSHA256”);
String ts = Long.toString(System.currentTimeMillis() - 30000);
String msg = String.format("%s%s%s%d", ZOOM_API_KEY, courseSession.getMeetingNumber(), ts, 0);
hasher.init(new SecretKeySpec(ZOOM_API_SECRET.getBytes(), "HmacSHA256"));
String message = Base64.getEncoder().encodeToString(msg.getBytes());
byte[] hash = hasher.doFinal(message.getBytes());
String hashBase64Str = DatatypeConverter.printBase64Binary(hash);
String tmpString = String
.format("%s.%s.%s.%d.%s", ZOOM_API_KEY, courseSession.getMeetingNumber(), ts, 0,
hashBase64Str);
String encodedString = Base64.getEncoder().encodeToString(tmpString.getBytes());
dto.setSignature(encodedString.replaceAll("\\=+$", ""));
} catch (Exception e) {
log.warn("Failed to generate zoom key", e);
throw new InvalidOperationException("Failed to generate zoom signature");
}
I even tried a signature generated through the node.js github project: zoom/websdk-sample-signature-node.js
Still same error.
The following is my angular code which tries to join the meeting.
joinMeeting(signature: string, apiKey: string, meetingNumber: string, passWord: string, userName: string) {
const leaveUrl = ‘/courses/detail/’ + this.courseId;
ZoomMtg.setZoomJSLib('assets/js/@zoomus/websdk/dist/lib', '/av');
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
ZoomMtg.init({
leaveUrl,
isSupportAV: true,
success: () => {
ZoomMtg.join({
meetingNumber,
passWord,
userName,
apiKey,
signature,
success: () => console.log('joined'),
error: (res) => console.log(res)
});
}
});
}
Could you please help me fix the issue.