ZoomMtg.join() returns "The signature has expired."

Thanks for sharing this @nafiudanlawal ! :slight_smile:

We really appreciate your contribution to the Zoom Developer Community!

-Tommy

Hello @tommy image

  var signature = ZoomMtg.generateSignature({
    meetingNumber: meetingConfig.mn,
    apiKey: API_KEY,
    apiSecret: API_SECRET,
    role: meetingConfig.role,
    success: function (res) {
      console.log(res.result);
      meetingConfig.signature = res.result;
      meetingConfig.apiKey = API_KEY;
      var joinUrl = "http://zoom-class.test/meeting.html?" + testTool.serialize(meetingConfig);
      console.log(joinUrl);
      window.open(joinUrl, "_blank");
    },
  });

after 24 hours create the signature is expired.
Can you please help me to sort out this issue asap?

Hey @salam.farrukh,

Thank you for reaching out to the Zoom Developer Forum. Are you hosting this meeting for the entire 24 hours and then seeing that the signature expires? Typically Zoom meetings have a maximum duration of 24 hours which could be a factor here.

Other than I would recommend that you generate the signature prior to the user joining and that should avoid expiration issues for each user as well.

I hope that helps! Let me know if you have any questions.

Thanks,
Max

I’m having the same issue.

I generate the signature on server side using the following code:

    public static string GenerateToken(string apiKey, string apiSecret, string meetingNumber, string ts, string role)
    {
        string message = String.Format("{0}{1}{2}{3}", apiKey, meetingNumber, ts, role);
        apiSecret = apiSecret ?? "";
        var encoding = new System.Text.ASCIIEncoding();
        byte[] keyByte = encoding.GetBytes(apiSecret);
        byte[] messageBytesTest = encoding.GetBytes(message);
        string msgHashPreHmac = System.Convert.ToBase64String(messageBytesTest);
        byte[] messageBytes = encoding.GetBytes(msgHashPreHmac);
        using (var hmacsha256 = new HMACSHA256(keyByte))
        {
            byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
            string msgHash = System.Convert.ToBase64String(hashmessage);
            string token = String.Format("{0}.{1}.{2}.{3}.{4}", apiKey, meetingNumber, ts, role, msgHash);
            var tokenBytes = System.Text.Encoding.UTF8.GetBytes(token);
            return System.Convert.ToBase64String(tokenBytes).TrimEnd(padding);
        }
    }

where the ts is generated using the following line:
var ts = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds().ToString();

Could you help me ??