why I am always getting invalid sdk key from signature function even after providing valid sdk key. here is the code I am using to generate signature, also cant able to integrate zoom in angular application
const oHeader = { alg: ‘HS256’, typ: ‘JWT’ }
const oPayload = {
sdkKey: ‘privided valid key’,
appKey: ‘privided valid key’,
mn: ‘vbnvbnbvn’,
role: 1,
iat: iat,
exp: exp,
tokenExp: iat + 60 * 60 * 2
}
const sHeader = JSON.stringify(oHeader)
const sPayload = JSON.stringify(oPayload)
const signature = KJUR.jws.JWS.sign(‘HS256’, sHeader, sPayload, ‘bvnbvnbvnbvnbvnvbn’)
res.json({
signature: signature
})
})
where do you define “iat” and “exp” ?
example on github
require('dotenv').config()
const express = require('express')
const bodyParser = require('body-parser')
const crypto = require('crypto')
const cors = require('cors')
const KJUR = require('jsrsasign')
const app = express()
const port = process.env.PORT || 4000
app.use(bodyParser.json(), cors())
app.options('*', cors())
app.post('/', (req, res) => {
const iat = Math.round(new Date().getTime() / 1000) - 30;
const exp = iat + 60 * 60 * 2
const oHeader = { alg: 'HS256', typ: 'JWT' }
This file has been truncated. show original
infos for troubleshooting signature
chunsiong.zoom
(Chun Siong (tag me for response))
July 13, 2023, 5:22am
3
@csepiyush ,
do you have a sample of your JWT token, and what version of the SDK are you using?