# Not able generate JWT token getting error 124 Invalid Access Token

**URL:** <https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491>\
**Category:** API and Webhooks\
**Created:** [April 16, 2020, 11:55am UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491 "2020-04-16T11:55:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShriG](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@ShriG](https://devforum.zoom.us/u/ShriG)\
**Post date:** [April 16, 2020, 11:55am UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491/1 "2020-04-16T11:55:53Z")

</div>

**Description**  
I am generating the JWT Token the code snippet is taken from the url [https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature](https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature)  
Following is the code

string apiKey = “myapikey taken from the JWT App”;  
string apiSecret = “myapisecret taken from the JWT App”;  
string meetingNumber = “my meeting number”;  
string role = “1”;

```
        DateTime Expiry = DateTime.UtcNow.AddMinutes(20);
        int ts = (int)(Expiry - new DateTime(2020, 4, 15)).TotalSeconds;

        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);
        }

```

The token is getting generated

**Error**  
The full error message or issue you are running into.

**Which App Type (JWT)?**  
app type is JWT

**Which Endpoint/s?**  
meetings/{MEETING ID}

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Token generated is Ymg5TlJSak1TN3FuTmFoU05JMjF1dy43NDM0MTUxMzE0LjEyODkyOC4xLldNZm14RXJpVmRYMWpHQS9FK2ZFNkExWE4zZkZabC9KSi93Mm9RYU5QWXM9
2. Consuming the API is giving {“code”:124,“message”:“Invalid access token.”} error.

**Screenshots (If applicable)**  
If applicable, add screenshots to help explain your problem.

**Additional context**  
Add any other context about the problem here.

---

<div class="post-metadata">

**Author:** ![shrijana.g](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shrijana.g/32/605_2.png) [@shrijana.g](https://devforum.zoom.us/u/shrijana.g)\
**Post date:** [April 17, 2020, 2:27am UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491/2 "2020-04-17T02:27:30Z")

</div>

Hi,

We are sorry that you are running into this issue. What happens when you use the token generated from your Marketplace JWT app? Are you getting the same error? If so could you send me your Zoom Account Number listed on your [Account Profile](https://support.zoom.us/hc/en-us/articles/115005731743-Account-profile) page via message?

Thank you,  
Shrijana

---

<div class="post-metadata">

**Author:** ![ShriG](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@ShriG](https://devforum.zoom.us/u/ShriG)\
**Post date:** [April 17, 2020, 11:57am UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491/3 "2020-04-17T11:57:40Z")

</div>

The token that i generate from the Marketplace JWT app that works.  
I don’t want to share my Account number here as others will be able to read that.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 19, 2020, 6:08am UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491/4 "2020-04-19T06:08:44Z")

</div>

Hey @ShriG,

Happy to hear it is working!

Let us know if you run into any other issues.

Thanks,  
tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:32pm UTC](https://devforum.zoom.us/t/not-able-generate-jwt-token-getting-error-124-invalid-access-token/13491/5 "2020-08-21T20:32:24Z")

</div>

Closed on August 21, 2020, 8:32pm UTC


