# Jwks\_uri inconsistent responses

**URL:** <https://forum.keycloak.org/t/jwks-uri-inconsistent-responses/30315>\
**Category:** Configuring the server\
**Tags:** oidc\
**Created:** [August 19, 2025, 4:46am UTC](https://forum.keycloak.org/t/jwks-uri-inconsistent-responses/30315 "2025-08-19T04:46:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmeyerin](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/pmeyerin/32/10764_2.png) [@pmeyerin](https://forum.keycloak.org/u/pmeyerin)\
**Post date:** [August 19, 2025, 4:46am UTC](https://forum.keycloak.org/t/jwks-uri-inconsistent-responses/30315/1 "2025-08-19T04:46:22Z")

</div>

Hi, all. Thanks in advance for any help.

I’m setting up keycloak in my prod environment for the first time. I have a fairly simple microservice ecosystem for now just to smoke test everything. I first got all this running in a local Docker, with everything including the Keycloak server exposed only through an Nginx reverse proxy. Everything was great.

So I deployed all this to my prod environment, which in this case in [fly.io](http://fly.io). The only changes for these purposes were a few URLs including the keycloak host. I wasn’t even using `start-dev` in the local for these purposes.

So here’s the strange behavior: in prod the jwks\_uri endpoint cycles through a few different pairs of signing and encryption keys. I’m seeing two of each. The result it that intermittently the KID in my bearer token doesn’t match the results of the jwks\_uri call, causing 401s. I’ve pulled that uri up in my browser and sure enough if I hit refresh a few times I get different results every few seconds.

Is this intended behavior? A security feature I am not familiar with? If so how do I manage it?
