# Basic question about JWKS URL

**URL:** <https://community.auth0.com/t/basic-question-about-jwks-url/138266>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [July 6, 2024, 6:53pm UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266 "2024-07-06T18:53:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhmh33usas](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mhmh33usas](https://community.auth0.com/u/mhmh33usas)\
**Post date:** [July 6, 2024, 6:53pm UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266/1 "2024-07-06T18:53:00Z")

</div>

Hi there,

I’m a little confused about JWKS. I know I need to retrieve it to validate my JWT, and I do this as below (via jose):

```auto
const withAuth = async (req, env) => {
    try {
        const getJwksUrl = env.AUTH0_DOMAIN+env.AUTH0_JWKS_URI;
        const jwks = createRemoteJWKSet(new URL(getJwksUrl));
        const header = req.headers.get('authorization');
        if (!header) throw 'missing token';
        const tkn = header.replace(/^Bearer\s/i, '');
        const options = {
            algorithms: ['RS256'],
            issuer: env.AUTH0_DOMAIN,
            audience: env.AUTH0_API_AUDIENCE
        };
       const result = await jwtVerify(tkn, jwks, options);
       req.userMeta = decodeJwt(tkn);
    } catch(e) {
        throw new StatusError(401, e);
    }
}

```

But my question is, should the JWKS be available in this way at a publicly-available URL? I can literally go to `https://<my-auth0-domain>/.well-known/jwks.json` and see my JWKS. I’m not sure if this worrying or not.

I found [this page](https://auth0.com/docs/secure/tokens/json-web-tokens/locate-json-web-key-sets), which tells you how to locate the JWKS, which sort of implies it should not be on a guessable URL but somewhere else? Mine seems to be available on the URL I mentioned above.

Any clarification much appreciated!

---

<div class="post-metadata">

**Author:** ![mhmh33usas](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mhmh33usas](https://community.auth0.com/u/mhmh33usas)\
**Post date:** [July 8, 2024, 11:51am UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266/2 "2024-07-08T11:51:16Z")

</div>

Can anyone help me 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:** [July 11, 2024, 12:03am UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266/4 "2024-07-11T00:03:40Z")

</div>

Hey there @mhmh33usas welcome to the community!

> [@mhmh33usas](#):
>
> But my question is, should the JWKS be available in this way at a publicly-available URL? I can literally go to `https://<my-auth0-domain>/.well-known/jwks.json` and see my JWKS. I’m not sure if this worrying or not.

Great question 🙂 Having the JWKS endpoint publicly available does not introduce a security risk, as the information it provides is meant to be public. The JWKS URL (`https://<my-auth0-domain>/.well-known/jwks.json`) is standard and adheres to the specifications for OpenID Connect and OAuth 2.0.

JWTs [signed with an asymmetric algorithm](https://auth0.com/docs/get-started/applications/signing-algorithms) (RS256 for example) rely on a **pair** of keys – A private key to sign the token and a public key to verify it. The security of this system relies on keeping the private key secure, while the public key is freely distributed to allow verification of the token’s authenticity.

---

<div class="post-metadata">

**Author:** ![mhmh33usas](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@mhmh33usas](https://community.auth0.com/u/mhmh33usas)\
**Post date:** [July 16, 2024, 7:46pm UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266/6 "2024-07-16T19:46:23Z")

</div>

That’s great, thanks so much.

I wonder if you’re able to help me with [this other question of mine](https://community.auth0.com/t/could-someone-clarify-what-exactly-client-isauthenticated-does/138293/1)? I’d be very grateful.

---

<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:** [July 30, 2024, 7:46pm UTC](https://community.auth0.com/t/basic-question-about-jwks-url/138266/7 "2024-07-30T19:46:38Z")

</div>

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