[keycloak-dev] min-time-between-jwks-requests Problems when running tests

Sebastien Blanc sblanc at redhat.com
Thu Mar 2 01:28:36 EST 2017


Yes it hit the same issue when I wrote tests for the nodejs adapter, also
took me a while before I discovered it was because of
the "min-time-between-jwks-requests" :/
Le jeu. 2 mars 2017 à 01:07, Bill Burke <bburke at redhat.com> a écrit :

> Ok, I just spent 1.5 days on debugging a problem and I was ready to
> throw my Laptop out of the window I was getting so frustrated.
>
> #1 I copied code from the arquillian adapter tests to deploy my own
> servlet.  When running in IntelliJ, all logging messages by the servlet
> and OIDC adapters were eaten and never displayed.
>
> #2 If you have a @Deployment it deploys it in @BeforeClass and only once
> for all tests run in the class
>
> #3 I  recreate/destroy my realms for every test
>
> #4 The default "min-time-between-jwks-requests" is 10 seconds...Because
> my servlet doesn't get redeployed per test, the 1st test would set up
> the cache for the realm key for the servlet.  The 2nd test would run,
> because the realms were recreated, there is a different key, but the
> min-time-between-jwkds-requests was 10 seconds so it wasn't updating the
> key and my logins would fail.  This was extermely frustrating to debug
> because of #1 and because it only happened if I was running all tests in
> the class.
>
> The workaround is to set "min-time-between-jwks-requests" to zero in
> your adapter configuration.  This is an FYI just in case somebody else
> runs into this.  Took me awhile to figure out.
>
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>


More information about the keycloak-dev mailing list