You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using OIDC based IdPs in Keycloak, Keycloak frequently makes HTTP requests to external systems (JWKS, Token, Userinfo endpoints). When the external IdP degrades for any reason and starts responding with error codes, or with long latencies, there are currently no facilities built into Keycloak to perform any kind of circuit breaking.
This leads to two core problems:
When response times increase, and there is a lot of incoming traffic, the HTTP thread pool may starve. When this happens, the entire Keycloak cluster is affected - even across realm boundaries
Continuing to hammer the IdP when they answer with for example with 503 Service Unavailable or 429 Too Many Requests is likely not to aid recovery
In the past, we've sometimes mitigated this by running a small proxy like traefik, but this requires to configure the proxy's URL and then manually configure URL rewriting on the proxy side. It might be better to have this capability in Keycloak itself?
Also, to alleviate the problem caused by 1.), we've been running a custom HttpClientFactory, which is essentially a line-for-line copy of the DefaultHttpClientFactory, except that instead of sharing the Connection Pool for the entire Keycloak cluster, we essentially maintain a ConcurrentHashMap<Realm, HttpClient> to reduce the blast radius if external HTTP requests in a single realm fill up the connection pool. Maybe that is also a change worth considering?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
When using OIDC based IdPs in Keycloak, Keycloak frequently makes HTTP requests to external systems (JWKS, Token, Userinfo endpoints). When the external IdP degrades for any reason and starts responding with error codes, or with long latencies, there are currently no facilities built into Keycloak to perform any kind of circuit breaking.
This leads to two core problems:
In the past, we've sometimes mitigated this by running a small proxy like traefik, but this requires to configure the proxy's URL and then manually configure URL rewriting on the proxy side. It might be better to have this capability in Keycloak itself?
Also, to alleviate the problem caused by 1.), we've been running a custom
HttpClientFactory, which is essentially a line-for-line copy of theDefaultHttpClientFactory, except that instead of sharing the Connection Pool for the entire Keycloak cluster, we essentially maintain aConcurrentHashMap<Realm, HttpClient>to reduce the blast radius if external HTTP requests in a single realm fill up the connection pool. Maybe that is also a change worth considering?All reactions