My name is Leonardo. I created an app-server-to-server and already got ApiKey, ApiSecret, ClientID.
Following the forum, I found an example in C# of how to generate the signature using my apikey and apisecret.
Every time I try to use the signature in Angular I get an error of ‘SdkKey invalid’ or sometimes ‘Signature invalid’
C# Post Method
[HttpPost(“GenerateSignatureZoom”)]
public string GenerateSignature(long meetingNumber, int role)
{
string apiKey = “wc2yJ3WxQ8ai1LQD37v48w”;
string apiSecret = “BCbtD8C3DSG0hJprqsLkoZZHn7P08tu6”;
long ToEpoch(DateTime value) => (value.Ticks - 621355968000000000) / (10000 * 1000);
var now = DateTime.UtcNow;
var iat = ToEpoch(now);
var exp = ToEpoch(now.AddDays(1));
var payload = new Dictionary<string, object>()
{
{ "appKey", apiKey },
{ "sdkKey", apiKey },
{ "mn", meetingNumber },
{ "roll", roll },
{ "iat", iat },
{ "exp", exp },
{ "tokenExp", exp },
};
return Jose.JWT.Encode(payload, Encoding.UTF8.GetBytes(apiSecret), JwsAlgorithm.HS256);
}
Angular
startMeeting() {
let meetingSDKElement = document.getElementById('meetingSDKElement');
this.ngZone.runOutsideAngular(() => {
this.client.init({zoomAppRoot: meetingSDKElement, language: 'en-US'}).then(() => {
this.client.join({
signature: this.signature,
sdkKey: this.sdkKey,
meetingNumber: this.meetingNumber,
password: this.passWord,
userName: this.userName,
userEmail: this.userEmail,
tk: this.registrantToken,
zak: this.zakToken
}).then(() => {
console.log('joined successfully')
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
})
}