Signature Invalid | Community
Skip to main content
Newcomer
April 24, 2024
Question

Signature Invalid

  • April 24, 2024
  • 1 reply
  • 8 views

Dear Zoom Support Team, I am writing to seek assistance regarding an issue we are facing with the Zoom Web SDK Client View. We have integrated the Zoom Web SDK into our web application to enable video conferencing capabilities for our users. However, we are encountering an “Invalid Signature” error when attempting to join a meeting using the generated signature. We have followed the documentation and guidelines provided by Zoom, but we are unable to resolve this issue on our own.

 

Example Sigature - 

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBLZXkiOiJMVHp6NzVCTlNBbTlGU0pWOFlWYmFRIiwiaWF0IjoxNzEzOTY1NTMzLCJleHAiOjE3MTQxMzgzMzMsInRva2VuRXhwIjoxNzE0MTM4MzMzLCJtbiI6MTIzNDU2Nywicm9sZSI6MSwic2RrS2V5IjoiTFR6ejc1Qk5TQW05RlNKVjhZVmJhUSJ9.St_WCdiY0d5DcvyFQ5zmZ48m2IwJrRq0lKyONBkOPHc

1 reply

Firas_ghobber
Community Champion | Partner
Community Champion | Partner
April 24, 2024

Hello, 

I'm intercepted with the some  error and i will share with you my js code how i'm generate signature code .

 

const generateSDKSignature = asyncHandler(async (req, res) => {
  const iat = Math.round(new Date().getTime() / 1000) - 30;

  const exp = iat + 60 * 60 * 2;

  const oHeader = { alg: "HS256", typ: "JWT", };

  const oPayload = {
    appKey: process.env.ZOOM_MSDK_KEY,
    sdkKey: process.env.ZOOM_MSDK_KEY,
    mn: req.body.meetingNumber,
    role: req.body.role,
    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,
 process.env.ZOOM_MSDK_SECRET
 



  );


  res.json({
    signature: signature,

  });

});