Intermittent Timeout Issue with OIDC Authentication in Keycloak v25.0.6 : 'SocketTimeoutException: Read timed out'

Hi All,
We are currently using Keycloak version 25.0.6, and we are encountering an intermittent issue while authenticating with an OIDC identity provider.

Occasionally, we are getting the following error during login:

Failed to make identity provider oauth callback: java.net.SocketTimeoutException: Read timed out

Due to this, users are unable to log in to the application when the error occurs.

Note: This issue occurs sporadically and is not consistently reproducible.

We would appreciate it if you could let us know:

  • Whether there is a way to resolve this issue, and
  • If it is possible to increase the timeout duration for the identity provider authentication API call.

Your assistance in resolving this issue would be greatly appreciated.

That’s a timeout doing an HTTP call to the IdP. It’s not an issue with Keycloak, but with connecting to your provider. You can tweak the HTTP timeouts with the connections-http-client variables, defined here: All provider configuration - Keycloak

E.g. we were having some problems with read timeouts to high-latency endpoints, so we set KC_SPI_CONNECTIONS_HTTP_CLIENT_DEFAULT_SOCKET_TIMEOUT_MILLIS=30000