i tried to use 2 fuction to generate signature but still invalid
generateSignature2( meetingNumber, role) {
ZoomMtg.generateSDKSignature({
meetingNumber: meetingNumber,
sdkKey: this.clientId,
sdkSecret: this.clientSecret,
role: role,
success: (res)=> {
this.startMeeting(res);
},
error: function(res) {
}
});
}
and
generateSignature( meetingNumber, role) {
const iat = Math.round(new Date().getTime() / 1000) - 30
const exp = iat + 60 * 60 * 2
const oHeader = { alg: 'HS256', typ: 'JWT' }
const oPayload = {
sdkKey: this.clientId,
appKey: this.clientId,
mn: meetingNumber,
role: role,
iat: iat,
exp: exp,
tokenExp: exp
}
const sHeader = JSON.stringify(oHeader)
const sPayload = JSON.stringify(oPayload)
const sdkJWT = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, this.clientSecret)
return sdkJWT
}