react-native-zoom-us
react-native-zoom-us copied to clipboard
Zoom.initialize requires jwToken
I was using react-native-zoom-us from past couple of months and it stops working suddenly then when i was debugging it i saw en error ZoomUS.initialize requires jwtToken i was using meeting sdk and client key, secerete key to authenticate and now suddenly it asking to jwt token but zoom deprecated jwt token long time ago what to do now?
same error
const header = {alg:"HS256",typ:"JWT"}; const payload = { appKey: sdkKey, // Your SDK key iat: new Date().getTime(), // access token issue timestamp in seconds exp: new Date().getTime() + 1000 * 3600 * 1000, // access token expire timestamp in epoch format, iat + a time less than 48 hours tokenExp: new Date().getTime() + 1000 * 3600 * 1000 // token expire time in epoch format, MIN:1800 seconds }; const hmacPayload = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(header))) + "." + CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(JSON.stringify(payload))); const sign = CryptoJS.HmacSHA256(hmacPayload, sdkSecret).toString(); const initializeResult = await ZoomUs.initialize({ jwtToken: hmacPayload + '.' + sign }, { language: 'vi', enableCustomizedMeetingUI: false, }, );
my code for generating jwtToken, but it can't work. The error 11 is showing
As of 5.14.10 the client key/secret are no longer supported https://developers.zoom.us/changelog/meeting-sdk/android/5.14.10
Any update on this? how we can get JWT token?
Any update on this? how we can get JWT token?
const KJUR = require('jsrsasign') // https://www.npmjs.com/package/jsrsasign
function generateSignature(key, secret, 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: key, appKey: key, 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, secret) return sdkJWT }
console.log(generateSignature('lnzkf0xiTE2Y3You4**', '5HZmjRPNQwAyO8729EsmPmAgNIYR***', 85075170923, 1))
this code for generate jwt token