Hi All,
Hoping someone can help me with my VUE.JS and ASP.NET C# project.
So, I’m testing the zoom meetings SDK for Vue.JS.
Now for this to work I need a signature end point.
In order to get a signature end point I need a meeting room number.
In order to get a meeting room number I need an OAUTH token.
In order to get an OAUTH token I need a valid code from the App I’ve created in my account.
So, having jumped through the above hoops, I get to the point of creating a signature endpoint and when I click a button to enter a meeting room I get signature invalid.
I do know having checked multiple times that I’m using the correct SDK client key and secret from the App account so it’s not that.
I’m coding everything back end in ASP.NET C# and can extract an App code, get an OAUTH token, create a meeting room, create a signature but it’s invalid.
Can anyone shed any light on why this may be.
Signature code:
[AllowAnonymous]
[HttpGet]
[Route("getsignature")]
public IHttpActionResult GetSignature(string meetingNumber)
{
string apiKey = "xxx";
string apiSecret = "xxx";
String ts = (ToTimestamp(DateTime.UtcNow.ToUniversalTime()) - 30000).ToString();
string role = "0";
string sig = GenerateToken(apiKey, apiSecret, meetingNumber, ts, role);
return Ok(sig);
}
public static long ToTimestamp(DateTime value)
{
long epoch = (value.Ticks - 621355968000000000) / 10000;
return epoch;
}
public static string GenerateToken(string apiKey, string apiSecret, string meetingNumber, string ts, string role)
{
char[] padding = { '=' };
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);
}
}
Front end enter room trigger is from meetingsdk-vuejs-sample
Thanks in advance,
Paul.