# How to create correct JWT token to access secure routes by Kong API gateway secured with JWT plugin and Auth0?

**URL:** <https://discuss.konghq.com/t/how-to-create-correct-jwt-token-to-access-secure-routes-by-kong-api-gateway-secured-with-jwt-plugin-and-auth0/6050>\
**Category:** General\
**Tags:** kong-gateway\
**Created:** [April 16, 2020, 1:32pm UTC](https://discuss.konghq.com/t/how-to-create-correct-jwt-token-to-access-secure-routes-by-kong-api-gateway-secured-with-jwt-plugin-and-auth0/6050 "2020-04-16T13:32:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![srkkhan](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@srkkhan](https://discuss.konghq.com/u/srkkhan)\
**Post date:** [April 16, 2020, 1:32pm UTC](https://discuss.konghq.com/t/how-to-create-correct-jwt-token-to-access-secure-routes-by-kong-api-gateway-secured-with-jwt-plugin-and-auth0/6050/1 "2020-04-16T13:32:58Z")

</div>

i am stuck with Kong API gateway. I am using JWT plugin with Auth0. following is the url for that: [JWT - Plugin | Kong Docs](https://docs.konghq.com/hub/kong-inc/jwt/) I have created consumer in Kong and created JWT credential as well for that consumer bu using RSA public key of Auth0. I have created some secure routes in Kong. I have created regular web application in Auth0 free account. i have setup sample NodeJs code given on Auth0 website in quickstart of regular web application with all required credentials. in that sample code i am able to get JWT token as access token. But when i use that token to access secured routes of Kong gateway, it is not working.

---

<div class="post-metadata">

**Author:** ![julio\_guerrero](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/julio_guerrero/32/2464_2.png) [@julio\_guerrero](https://discuss.konghq.com/u/julio_guerrero)\
**Post date:** [January 7, 2021, 5:35pm UTC](https://discuss.konghq.com/t/how-to-create-correct-jwt-token-to-access-secure-routes-by-kong-api-gateway-secured-with-jwt-plugin-and-auth0/6050/2 "2021-01-07T17:35:46Z")

</div>

Did you solve the problem?
