# SDK Authorization failed MobileRTCAuthError(rawValue: 11) and Invalid signature

**URL:** <https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587>\
**Category:** Authentication\
**Created:** [April 24, 2024, 3:40pm UTC](https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587 "2024-04-24T15:40:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![farooqih11](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/farooqih11/32/59032_2.png) [@farooqih11](https://devforum.zoom.us/u/farooqih11)\
**Post date:** [April 24, 2024, 3:40pm UTC](https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587/1 "2024-04-24T15:40:03Z")

</div>

Hi, I’m currently integrating Zoom Meeting SDK version 5.17.10 into my application. I’ve implemented the OAuth flow, starting with the creation of an OAuth token (using server-to-server OAuth). From there, I generated a ZAK token, and finally, I created a JWT for the Meeting SDK. However, when I use this JWT token in my iOS application, I encounter an error: ‘SDK Authorization failed’ with error code MobileRTCAuthError(rawValue: 11). Could anyone please help me identify the issue?  
header {  
“alg”: “HS256”,  
“typ”: “JWT”  
} payload like this {  
“appKey”: ZOOM\_MEETING\_SDK\_KEY\_OR\_CLIENT\_ID,  
“sdkKey”: ZOOM\_MEETING\_SDK\_KEY\_OR\_CLIENT\_ID,  
“mn”: MEETING\_NUMBER,  
“role”: ROLE,  
“iat”: 1646937553,  
“exp”: 1646944753,  
“tokenExp”: 1646944753  
}  
HMACSHA256(  
base64UrlEncode(header) + ‘.’ + base64UrlEncode(payload),  
ZOOM\_MEETING\_SDK\_SECRET\_OR\_CLIENT\_SECRET  
);

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [April 29, 2024, 2:34am UTC](https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587/2 "2024-04-29T02:34:46Z")

</div>

@farooqih11 ,

Auth Signature / JWT Token for Meeting SDK does not require OAuth Flow.

You will need to create either a Meeting SDK App (Legacy), or General App (with Meeting SDK Function enabled), use the Client ID and Client Secret to sign the token.

> **[Meeting SDK Auth](https://developers.zoom.us/docs/meeting-sdk/auth/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![farooqih11](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/farooqih11/32/59032_2.png) [@farooqih11](https://devforum.zoom.us/u/farooqih11)\
**Post date:** [May 9, 2024, 3:27pm UTC](https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587/3 "2024-05-09T15:27:33Z")

</div>

@chunsiong.zoom hi, I have sign the token with clientId and Clientsecret but still getting same error. please help in finding the exact issue. here is my code for generating token…  
public static string GenerateSignature(string clientId, string clientSecret, long meetingNumber, int role)  
{  
// Prepare the header  
var header = new Dictionary\<string, object\>  
{  
{ “alg”, “HS256” },  
{ “typ”, “JWT” }  
};  
string headerJson = Newtonsoft.Json.JsonConvert.SerializeObject(header);

```
    // Convert the headerJson string to a byte array
    byte[] headerBytes = Encoding.UTF8.GetBytes(headerJson);
    string base64UrlEncodedHeader = Base64UrlEncode(headerBytes);

    // Prepare the payload
    var payload = new Dictionary<string, object>
    {
        { "appKey", clientId },
        { "sdkKey", clientId }, // sdkKey is deprecated but still included for compatibility
        { "mn", meetingNumber },
        { "role", role },
        { "iat", (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds },
        { "exp", (long)(DateTime.UtcNow.AddHours(2).Subtract(new DateTime(1970, 1, 1))).TotalSeconds },
        { "tokenExp", (long)(DateTime.UtcNow.AddHours(2).Subtract(new DateTime(1970, 1, 1))).TotalSeconds }
    };
    string payloadJson = Newtonsoft.Json.JsonConvert.SerializeObject(payload);

    // Convert the payloadJson string to a byte array
    byte[] payloadBytes = Encoding.UTF8.GetBytes(payloadJson);
    string base64UrlEncodedPayload = Base64UrlEncode(payloadBytes);

    // Concatenate the base64UrlEncodedHeader and base64UrlEncodedPayload with a period
    string dataToSign = base64UrlEncodedHeader + '.' + base64UrlEncodedPayload;

    // Hash the concatenated data using HMAC SHA256
    byte[] signatureBytes;
    using (var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(clientSecret)))
    {
        signatureBytes = hmac.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));
    }

    if (signatureBytes == null)
    {
        throw new InvalidOperationException("Signature cannot be null.");
    }

    // Encode the signature bytes to Base64 URL format
    string signature = Base64UrlEncode(signatureBytes);

    return dataToSign + '.' + signature;
}

private static string Base64UrlEncode(byte[] input)
{
    return Convert.ToBase64String(input)
        .Replace('+', '-')
        .Replace('/', '_')
        .TrimEnd('=');
}

```

}

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [May 10, 2024, 4:10am UTC](https://devforum.zoom.us/t/sdk-authorization-failed-mobilertcautherror-rawvalue-11-and-invalid-signature/108587/4 "2024-05-10T04:10:22Z")

</div>

@farooqih11 I’ll PM you for the JWT Token and meeting details
