Creating Signature Server side with C#

I’m trying to generate my signature on my server with C#. I have everything else working and running smoothly when run on the client but cant get it to work when i switch it over to run on C#.

  1. errorCode: 200
  2. reason: “Verify JWT failed”
  3. type: "JOIN_MEETING_FAILED

Video SDK version 1.1.3
On Angular 12 & C# .Net Core 3.1

What I have so far

public string GenerateSignature(string topic=“Default Topic”)
{
var signature = string.Empty;

        var iat = Math.Round(GetTime()/ 1000);
        var exp = iat + 7200;

        var appSettingsJson = AppSettingsJson.GetAppSettings();
        var sdkKey = appSettingsJson["Data:ZoomInfo:SdkKey"];
        var sdkSecret = appSettingsJson["Data:ZoomInfo:SdkSecret"];

        var claims = new List<Claim>
            {
                new Claim("app_key", sdkKey),
                new Claim("iat", iat.ToString(CultureInfo.InvariantCulture)),
                new Claim("exp", exp.ToString(CultureInfo.InvariantCulture)),
                new Claim("tpc", topic),
                new Claim("pwd", string.Empty)
            };

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

        var secToken = new JwtSecurityToken(
               sdkKey,
               null,
               claims,
               DateTime.UtcNow,
               DateTime.UtcNow.AddHours(10),
               credentials);

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

        return signature;
    }

Any help on this or examples would be much appreciated

Hey @dataonedigital ,

We do not have any examples of generating Video SDK signatures in C# yet.

That being said, if you send your signature and a link to this thread to developersupport@zoom.us we will help you debug your signature. :slight_smile:

Thanks,
Tommy

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