mieszko4 / react-native-zoom-us

MIT License
122 stars 115 forks source link

Zoom.initialize requires jwToken #340

Open hmadJutt opened 3 months ago

hmadJutt commented 3 months ago

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?

vijaykhandal1290 commented 3 months ago

same error

princetoad1995 commented 3 months ago

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

wilkinson4 commented 2 months ago

As of 5.14.10 the client key/secret are no longer supported https://developers.zoom.us/changelog/meeting-sdk/android/5.14.10

Yamini0 commented 2 months ago

Any update on this? how we can get JWT token?

vijaykhandal1290 commented 2 months ago

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