Hey,
I’m creating app which should create meeting via API, next users join to this meeting using only browser.
I’ve created app “Server-to-Server OAuth” in Zoom Market.
I have a working creating access token.
I have a working creating meeting using API with this access token.
And next I wanna start video using component-view like here https://github.com/zoom/meetingsdk-javascript-sample/blob/master/component-view.js
But I got error from SDK “signature is invalid. Error code: 3712”.
My code:
ruby - create signature
iat = Time.now.to_i - 30
exp = iat + 60 * 60 * 2
header = {
alg: 'HS256',
typ: 'JWT'
}
payload = {
sdkKey: client_id,
appKey: client_id,
mn: meeting_id,
role: 0,
iat: iat,
exp: exp,
tokenExp: exp
}
signature = JWT.encode(payload, client_secret, 'HS256', header)
Signature is like this:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJDODZjSllIclJmbXozNVo5UkhxR2tnIiwiYXBwS2V5IjoiQzg2Y0pZSHJSZm16MzVaOVJIcUdrZyIsIm1uIjo4NDE3MDMxMDc5Mywicm9sZSI6MCwiaWF0IjoxNjk1MjA0MzE5LCJleHAiOjE2OTUyMTE1MTksInRva2VuRXhwIjoxNjk1MjExNTE5fQ.B2DUipxAe_LNzm8CyfQstom5Qc7fP7QypsuCq38BjZQ
JS SDK:
const client = ZoomMtgEmbedded.createClient()
let meetingSDKElement = document.getElementById('video-call')
var authEndpoint = ''
var sdkKey = ''
var meetingNumber = "MEETING_NUMBER";
var passWord = '';
var role = 1;
var userName = 'JavaScript'
var userEmail = ''
var registrantToken = ''
var zakToken = ''
client.init({
zoomAppRoot: meetingSDKElement,
language: 'en-US',
})
client.join({
role: 1,
signature: "SIGNATURE",
sdkKey: 'CLIENT_ID',
meetingNumber: meetingNumber,
password: passWord,
userName: userName,
userEmail: userEmail,
tk: registrantToken,
zak: zakToken
})
MEETING_NUMBER, SIGNATURE, CLIENT_ID - these are variables from ruby. So values are correct.
Please help me. I’m stuck on with this.