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
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;
}