# Zoom jwt authentication

**URL:** <https://devforum.zoom.us/t/zoom-jwt-authentication/25614>\
**Category:** API and Webhooks\
**Created:** [July 29, 2020, 4:21pm UTC](https://devforum.zoom.us/t/zoom-jwt-authentication/25614 "2020-07-29T16:21:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trupti.patlekar](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@trupti.patlekar](https://devforum.zoom.us/u/trupti.patlekar)\
**Post date:** [July 29, 2020, 4:21pm UTC](https://devforum.zoom.us/t/zoom-jwt-authentication/25614/1 "2020-07-29T16:21:52Z")

</div>

**Description**  
Hi team,  
In my web application , I am calling zoom create api using jwt token which is generated by using api\_key and secret key which giving me response as expected on local server (development environment).But same on production giving me “” blank response.

What to do in order to get proper response on production.

Same apikey and secret key are used to generate jwt token on production.

**Error**  
Not getting error but getting 200 status code and blank response

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
Jwt app type Account type basic  
**Which Endpoint/s?**  
api\_key and secret key

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:  
var client = new RestClient(“[https://api.zoom.us/v2/users/me/meetings](https://api.zoom.us/v2/users/me/meetings)”);  
//var client = new RestClient(“[https://api.zoom.us/v2/users?status=active&page\_size=300&page\_number=1](https://api.zoom.us/v2/users?status=active&page_size=300&page_number=1)”);  
var request = new RestRequest(Method.POST);  
request.AddHeader(“content-type”, “application/json”);  
request.AddHeader(“authorization”, String.Format(“Bearer {0}”, ZoomUtility.ZoomToken()));  
// request.AddHeader(“authorization”, String.Format(“Bearer {0}”, “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOm51bGwsImlzcyI6IkVPTVJXb2g3UU5tbTBDUTdHRUszenciLCJleHAiOjE1OTYwMzgyODAsImlhdCI6MTU5NTk1MTg5Mn0.AmBujF-9uN2ttlzKn1szm8GoADDiKh2XIGn-mp4\_6kc”));  
request.AddParameter(“application/json”, “{“topic”:“Meeting”,“type”:“1”,“start\_time”:”" + sdate + “”,“duration”:“120”,“schedule\_for”:null,“timezone”:“Asia/Calcutta”,“password”:"",“agenda”:"",“recurrence”:{“type”:“2”,“repeat\_interval”:"",“weekly\_days”:"",“monthly\_day”:"",“monthly\_week”:"",“monthly\_week\_day”:"",“end\_times”:"",“end\_date\_time”:"" + edate + “”},“settings”:{“host\_video”:true,“participant\_video”:false,“cn\_meeting”:false,“in\_meeting”:true,“join\_before\_host”:false,“mute\_upon\_entry”:false,“watermark”:false,“use\_pmi”:false,“approval\_type”:“1”,“registration\_type”:“1”,“audio”:"",“auto\_recording”:"",“enforce\_login”:"",“enforce\_login\_domains”:"",“alternative\_hosts”:"",“global\_dial\_in\_countries”:[""],“registrants\_email\_notification”:true}}", ParameterType.RequestBody);  
IRestResponse response = client.Execute(request);  
var content = response.Content;  
public static string ZoomToken()  
{  
// Token will be good for 20 minutes  
DateTime Expiry = DateTime.UtcNow.AddMinutes(20);

```
        int ts = (int)(Expiry - new DateTime(1970, 1, 1)).TotalSeconds;
        string apiSecret = ZoomAPISecretString();
        string apiKey = ZoomAppKeyString();
        // Create Security key using private key above:
        var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(apiSecret));

        // I did changes in below line because DLL needed HmacSha256Signature instead of HmacSha256
        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);

        //Finally create a Token
        var header = new JwtHeader(credentials);

        //Zoom Required Payload
        var payload = new JwtPayload { { "iss", apiKey }, { "exp", ts }, };

        var secToken = new JwtSecurityToken(header, payload);
        var handler = new JwtSecurityTokenHandler();

        // Token to String so you can use it in your client
        var tokenString = handler.WriteToken(secToken);

        return tokenString;
    }
```

---

<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:** [July 31, 2020, 8:26pm UTC](https://devforum.zoom.us/t/zoom-jwt-authentication/25614/2 "2020-07-31T20:26:32Z")

</div>

Hey @trupti.patlekar,

Please share your request body JSON and response body JSON when making your [Create Meeting request.](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 10, 2020, 8:26pm UTC](https://devforum.zoom.us/t/zoom-jwt-authentication/25614/3 "2020-08-10T20:26:34Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
