Description
I am using React with the following flow through
const authorizationUrl = https://zoom.us/oauth/authorize?response_type=code&client_id=${clientID}&redirect_uri=${redirectURI}
;
After that, I proceed with creating an OAuth token as follows -
const tokenResponse = await axios.post('https://zoom.us/oauth/token', querystring.stringify({
grant_type: 'authorization_code',
code: authorizationCode,
redirect_uri: redirectURI
}), {
headers: {
'Authorization': `Basic ${Buffer.from(`${clientID}:${clientSecret}`).toString('base64')}`,
'Content-Type': 'application/x-www-form-urlencoded'
}
});
const accessToken = tokenResponse.data.access_token;
After that, I pass this token using the official file provided at this instance to initiate handshake and get the signature -
https://github.com/zoom/meetingsdk-auth-endpoint-sample/blob/master/src/index.js
After I get the response signature, I call the start meeting -
document.getElementById('zmmtg-root').style.display = 'block'
ZoomMtg.init({
leaveUrl: leaveUrl,
patchJsMedia: true,
leaveOnPageUnload: true,
success: () => {
ZoomMtg.join({
signature,
sdkKey,
meetingNumber,
passWord,
userName,
userEmail,
tk: registrantToken,
zak: zakToken,
success: (success) => {
console.log(success)
ZoomMtg.getAttendeeslist({});
ZoomMtg.getCurrentUser({
success: function (res) {
console.log("success getCurrentUser", res.result.currentUser);
},
});
},
error: (error) => {
console.log(error)
}
})
},
error: (error) => {
console.log(error)
}
})
}
Error?
If my role is 0
{
"method": "join",
"status": false,
"result": "Invalid signature.",
"errorCode": 3712,
"errorMessage": "Signature is invalid."
}
Joining Meeting Timeout or Browser restriction
Signature is invalid.
If my role is 1
{
"method": "join",
"status": false,
"result": "Not support start meeting via tokens",
"errorCode": 3265,
"errorMessage": "Token error"
}
Joining Meeting Timeout or Browser restriction
Token error
What am I doing wrong??