Meeting Sdk Web SDK Show Expire signature

Meeting SDK/ Web SDK Show Expire or invalid signature error:

Description
On Start new meeting from angular Project using Meeting SDK , It show Expire Signature popup,
When I Clicked on retry 4,5 times than it start working


Signature :“[REDACTED]”

post your code for creating the signature

Hi @j.schoenemeyer

 private string GenerateSignature(long meetingNumber, int role)
        {
            var currentDateTime = DateTime.UtcNow;
            var unixEpoch = DateTime.UnixEpoch;
            long iat = (long)currentDateTime.Subtract(unixEpoch).TotalSeconds;
            var exp = (long)(currentDateTime.AddDays(1)).Subtract(unixEpoch).TotalSeconds;

            var claims = new List<Claim>
            {
                new Claim("app_key", _zoomApiOptions.SdkKey),
                new Claim("sdkKey", _zoomApiOptions.SdkKey),
                new Claim("mn", meetingNumber.ToString()),
                new Claim("role", role.ToString()),
                new Claim("iat", iat.ToString(CultureInfo.InvariantCulture)),
                new Claim("exp", exp.ToString(CultureInfo.InvariantCulture)),
                new Claim("tokenExp", exp.ToString(CultureInfo.InvariantCulture)),
            };

            var encoding = new ASCIIEncoding();
            byte[] keyByte = encoding.GetBytes(_zoomApiOptions.SdkSecret);
            var securityKey = new SymmetricSecurityKey(keyByte);
            var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);

            var secToken = new JwtSecurityToken(
                   _zoomApiOptions.SdkKey,
                   null,
                   claims,
                   currentDateTime,
                   currentDateTime.AddDays(1),
                   credentials);

            var handler = new JwtSecurityTokenHandler();
            var signature = handler.WriteToken(secToken);

            return signature;
        }

When I Clicked on retry 4,5 times than it start working

your “iat” is wrong, it should be currentTime minus 30 seconds

https://marketplace.zoom.us/docs/sdk/native-sdks/auth/#generate-the-sdk-jwt

this is your signature

{
  "alg":"HS256",
  "typ":"JWT"
}
{
  "app_key": "FtNd3dy6eT5CbV5HV926...",
  "sdkKey":  "FtNd3dy6eT5CbV5HV926...",
  "mn":      "876566...",
  "role":    "1",
  "iat":     "1670601764",  // Friday,    9 December 2022 16:02:44
  "exp":      1670688164,   // Saturday, 10 December 2022 16:02:44
  "tokenExp":"1670688164",  // Saturday, 10 December 2022 16:02:44
  "nbf":      1670601764,   // Friday, 9 December 2022 16:02:44
  "iss":      "FtNd3dy6eT5CbV5HV926..."
}

this is a signature made with the zoom reference implementation

{
  "alg":"HS256",
  "typ":"JWT"
}
{
  "sdkKey":   "37Hm4tqH3hivbcic7trVNwgqhSGe....",
  "mn":       "8703113....",
  "role":     1,
  "iat":      1662728120,   // Friday, 9 September 2022 12:55:20
  "exp":      1662735320,   // Friday, 9 September 2022 14:55:20
  "appKey":   "37Hm4tqH3hivbcic7trVNwgqhSGe....",
  "tokenExp": 1662735320    // Friday, 9 September 2022 14:55:20
}

i would follow zoom’s example exactly

1 Like

@j.schoenemeyer,

Thank you for your help and contribution to the Zoom Developer Forum!

@qasatti,

Are you still facing issues creating Zoom SDK signature? Please let us know if there is anything we can help with.

Hey @j.schoenemeyer , @donte.zoom

I added a difference of 30 seconds and its start working,
Thanks

1 Like

Splendid, thank you for sharing this update @qasatti ~

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.