Generate SDK Signature with ASP.NET Core (C#) backend

@allen ,

Great question! I believe you just need to create a function that handles creating the SDK JWT and endpoint that will return the token. The endpoint should be a POST and take the meeting number and role.

POST http://localhost:8080
{
“meetingNumber”: “94843468909”,
“role”: 0
}

SDK JWT consists of three parts:

  1. Header: encoded data of the token type and the algorithm used to sign the data.
{
  "alg": "HS256",
  "typ": "JWT"
}
  1. Payload: encoded data of claims intended to share.
{
  "appKey": SDK_KEY,
  "sdkKey": SDK_KEY,
  "mn": MEETING_NUMBER,
  "role": ROLE,
  "iat": 1646937553,
  "exp": 1646944753,
  "tokenExp": 1646944753
}
  1. Signature: created by signing (encoded header + encoded payload) using the SDK secret through an HMAC SHA256 algorithm.
HMACSHA256(
  base64UrlEncode(header) + '.' + base64UrlEncode(payload),
  SDK_SECRET
);

Here is our help documentation with those details for your reference :smiley:

Generate the SDK JWT

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

Let me know if I missing anything. If so, can you share more details regarding your current implementation? This will help provide more context on what needs to be changed. In the meantime, I did some googling and found some helpful resources on generating JWT tokens.

https://www.c-sharpcorner.com/article/how-to-implement-jwt-authentication-in-web-api-using-net-6-0-asp-net-core/