# Jwt token creation error

**URL:** <https://devforum.zoom.us/t/jwt-token-creation-error/53190>\
**Category:** API and Webhooks\
**Created:** [June 26, 2021, 7:03am UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190 "2021-06-26T07:03:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinayak.chaurasia](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vinayak.chaurasia](https://devforum.zoom.us/u/vinayak.chaurasia)\
**Post date:** [June 26, 2021, 7:03am UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/1 "2021-06-26T07:03:00Z")

</div>

## Using this template helps us debug your issues more effectively 🙂

**Description**  
I am trying to integrate zoom API with the Spring Boot application, If I use the JWT token created online and hard code it in the application I am able to send a request to the meeting creation API and create a new meeting successfully. I want to automate the JWT creation process but the JWT creation method throws an error and JWT creation fails and leads to application failure

**Error**  
The specified key byte array is 136 bits which is not secure enough for any JWT HMAC-SHA algorithm. The JWT JWA Specification (RFC 7518, Section 3.2) states that keys used with HMAC-SHA algorithms MUST have a size \>= 256 bits (the key size must be greater than or equal to the hash output size). Consider using the io.jsonwebtoken.security.Keys#secretKeyFor(SignatureAlgorithm) method to create a key guaranteed to be secure enough for your preferred HMAC-SHA algorithm. See [RFC 7518 - JSON Web Algorithms (JWA)](https://tools.ietf.org/html/rfc7518#section-3.2) for more information.  
at io.jsonwebtoken.security.Keys.hmacShaKeyFor(Keys.java:96) ~[jjwt-api-0.11.2.jar:0.11.2]

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
[https://api.zoom.us/v2/users/{userid}/meetings](https://api.zoom.us/v2/users/%7Buserid%7D/meetings)

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

private String generateZoomJWTToken(){  
String id = UUID.randomUUID().toString().replace(“-”, “”);  
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;  
Date creation = new Date(System.currentTimeMillis());  
Date expiry = new Date(System.currentTimeMillis()+(1000\*60));  
SecretKey key =  
Keys.hmacShaKeyFor(zoomApiSecret.getBytes(StandardCharsets.UTF\_8));//This line throws error

```
    return Jwts.builder()
            .setId(id)
            .setIssuer(zoomApiKey)
            .setIssuedAt(creation)
            .setSubject("")
            .setExpiration(expiry)
            .signWith(key,signatureAlgorithm)
            .compact();

}

```

**Screenshots (If applicable)**

 ![Screenshot from 2021-06-26 12-24-57](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/a/f/af240f7ab905ad26f837a0813cc80813d1e41856.png)  
Line no. 81 throws error

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

---

<div class="post-metadata">

**Author:** ![vinayak.chaurasia](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vinayak.chaurasia](https://devforum.zoom.us/u/vinayak.chaurasia)\
**Post date:** [June 28, 2021, 4:17am UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/2 "2021-06-28T04:17:01Z")

</div>

Hi @zoom61 any links or solution for the problem would help

---

<div class="post-metadata">

**Author:** ![vinayak.chaurasia](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vinayak.chaurasia](https://devforum.zoom.us/u/vinayak.chaurasia)\
**Post date:** [June 28, 2021, 9:33am UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/3 "2021-06-28T09:33:32Z")

</div>

Hi @will.zoom can you help me with this? It has been 2 days but I have not received any response from the team.

---

<div class="post-metadata">

**Author:** ![vinayak.chaurasia](https://avatars.discourse-cdn.com/v4/letter/v/7bcc69/32.png) [@vinayak.chaurasia](https://devforum.zoom.us/u/vinayak.chaurasia)\
**Post date:** [June 29, 2021, 12:16pm UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/4 "2021-06-29T12:16:21Z")

</div>

Hi, @zoom1234 Team I was able to solve the issue. It was a typo issue.

---

<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:** [June 29, 2021, 4:23pm UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/5 "2021-06-29T16:23:37Z")

</div>

Happy to hear you were able to resolve it. 🙂

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:** [July 30, 2021, 2:24am UTC](https://devforum.zoom.us/t/jwt-token-creation-error/53190/6 "2021-07-30T02:24:02Z")

</div>

Closed on July 30, 2021, 2:24am UTC

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