Expected Behavior
Fetching JWKSets should timeout if the server does not respond in specified amount of time.
Current Behavior
Currently, the jwtDecoder will block until the socket hangs up, which can take few minutes. This is due to the usage of the default RestTemplate in NimbusJwtDecoder which uses the SimpleClientRequestFactory without a timeout by default.
Context
This issue only affects oAuth flows with private_key_jwt client authentication.
To mitigate this issue we implemented a custom JwtClientAssertionFactory that uses a RestTemplate with an explicit timeout.