Video SDK JWT token invalid:
I am using the React-demo of the Zoom Video SDK, version 1.5.5 and I get the error
Description
I have the following function to generate the JWT token. But when the token is used, the error above shows and the SDK does not start.
Browser Console Error
{
type: 'JOIN_MEETING_FAILED',
reason: 'Verify JWT failed',
errorCode: 200
}
Which Web Video SDK version?
Zoom Video SDK, version 1.5.5
Video SDK Code Snippets
generateVideoToken(
sdkKey: string,
sdkSecret: string,
topic: string,
passWord = '',
userIdentity = '',
sessionKey = '',
roleType = 1
) {
let signature = '';
try {
const iat = Math.round(new Date().getTime() / 1000);
const exp = iat + 60 * 60 * 2;
// Header
const oHeader = { alg: 'HS256', typ: 'JWT' };
// Payload
const oPayload = {
app_key: sdkKey,
iat,
exp,
tpc: topic,
pwd: passWord,
user_identity: userIdentity,
session_key: sessionKey,
role_type: roleType // role = 1 for host, 0 for attendee; a host must first start a session for attendees to join
// topic
};
const sHeader = JSON.stringify(oHeader);
const sPayload = JSON.stringify(oPayload);
signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret);
} catch (e) {
console.error(e);
}
return signature;
}
Additional context
Please state what might be wrong here because this has been working for the past 6 months of usage, but the error just surfaced recently.