# Which sectet do I need to verify the jwt in NodeJS?

**URL:** <https://community.auth0.com/t/which-sectet-do-i-need-to-verify-the-jwt-in-nodejs/99555>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [February 2, 2023, 11:08am UTC](https://community.auth0.com/t/which-sectet-do-i-need-to-verify-the-jwt-in-nodejs/99555 "2023-02-02T11:08:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikamanelka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mikamanelka/32/44266_2.png) [@mikamanelka](https://community.auth0.com/u/mikamanelka)\
**Post date:** [February 2, 2023, 11:08am UTC](https://community.auth0.com/t/which-sectet-do-i-need-to-verify-the-jwt-in-nodejs/99555/1 "2023-02-02T11:08:23Z")

</div>

I want to use a middleware like that:

`const verifyToken = (req, res, next) => { const token = req.headers.authorization.split(" ")[1]; const verifiedToken = jwt.verify( token, "which secret to use here?" ); next(); };`

I tried every Client Secret I could find in my Auth0 account, but none worked.  
Can you tell me which secret to use here?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 4, 2023, 12:30am UTC](https://community.auth0.com/t/which-sectet-do-i-need-to-verify-the-jwt-in-nodejs/99555/3 "2023-02-04T00:30:48Z")

</div>

Hi there @mikamanelka welcome to the community!

> [@mikamanelka](#):
>
> I tried every Client Secret I could find in my Auth0 account, but none worked.  
> Can you tell me which secret to use here?

Auth0 exposes a JWKS endpoint for each tenant, which is found at `https://YOUR_DOMAIN/.well-known/jwks.json` . This endpoint will contain the JWK used to verify all Auth0-issued JWTs for this tenant.

> **[JSON Web Key Sets](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-key-sets)**
>
> A JSON Web Key set is a JSON object which represents a set of JSON Web Keys (a JSON object that represents a cryptographic key).

See `secretOrPublicKey` here:

> **[GitHub - auth0/node-jsonwebtoken: JsonWebToken implementation for node.js...](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback)**
>
> JsonWebToken implementation for node.js http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html - GitHub - auth0/node-jsonwebtoken: JsonWebToken implementation for node.js http://self-iss...

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 18, 2023, 12:30am UTC](https://community.auth0.com/t/which-sectet-do-i-need-to-verify-the-jwt-in-nodejs/99555/4 "2023-02-18T00:30:58Z")

</div>

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