Description
I’m using Server-to-server app to embed zoom in our application. I’m able to call Rest API’s with access_token generated with /authorize API call, But unable to join zoom with meeting SDK.
I tried using generateSDKSignature like the following to generate signature:
ZoomMtg.generateSDKSignature({
meetingNumber: meetingNumber,
sdkKey: clientId,
sdkSecret: clientSecret,
role: 0,
success: function (res) {
generatedSignature = res.result;
}
});
Using the generatedSignature to join the meeting as following :
zoomIframeWindow.ZoomMtg.init({
leaveUrl: zoomIframeWindow.location.href,
success: function () {
unloadWindowListener(false);
zoomIframeWindow.ZoomMtg.i18n.load(meetingConfig.lang);
zoomIframeWindow.ZoomMtg.i18n.reload(meetingConfig.lang);
zoomIframeWindow.ZoomMtg.join({
meetingNumber: meetingConfig.meetingNumber,
userName: meetingConfig.userName,
userEmail: meetingConfig.userEmail,
passWord: meetingConfig.passWord,
signature: meetingConfig.signature,
sdkKey: meetingConfig.clientId,
success: function (res) {
console.log("joined successfully");
},
error: function (res) {
console.log("joining meeting failed");
}
});
},
error: function (res) {
console.log(res);
},
});
Browser Console Error
“Signature is Expired”
Which Web Meeting SDK version?
Meeting SDK version : 2.11.0
Meeting SDK Code Snippets
Provided above
Troubleshooting Routes
I have tried populating the signature in java as well, Getting same error
private String createJWTToken(String zoomClientId, String zoomClientSecret, String meetingNumber, String role) throws InvalidKeyException, NoSuchAlgorithmException, JSONException {
//Header
JSONObject header = new JSONObject();
header.put("alg", "HS256");
header.put("typ", "JWT");
//payload
ZonedDateTime currentTime = ZonedDateTime.now(ZoneOffset.UTC).minusSeconds(30);
JSONObject payload = new JSONObject();
payload.put("sdkKey", zoomClientId);
payload.put("mn", meetingNumber);
payload.put("role", role);
payload.put("iat", currentTime.toInstant().toEpochMilli());
payload.put("exp", currentTime.plusDays(1).toInstant().toEpochMilli());
payload.put("tokenExp", currentTime.plusDays(1).toInstant().toEpochMilli());
String encodedHeader = Base64.getUrlEncoder().withoutPadding()
.encodeToString(header.toString().getBytes(StandardCharsets.UTF_8));
String encodedPayload = Base64.getUrlEncoder().withoutPadding()
.encodeToString(payload.toString().getBytes(StandardCharsets.UTF_8));
String signature = hmacSha256(encodedHeader + "." + encodedPayload, zoomClientSecret);
return encodedHeader + "." + encodedPayload + "." + signature;
}
Device (please complete the following information):
- Device: Macbook Pro
- OS: 12.5.1
- Browser: Chrome and Safari