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
{{ message }}
Repository navigation
Support long-running blocking operations in authenticator SPIs
#39625
We have a custom SPI that overrides the Authenticator interface. Our business case requires making an API call that sometimes can take up to 10 seconds. We realise that this is not a good approach, but we have no opportunities to change this behaviour because our team does not own this 3-rd party API.
We have updated client timeout to 10 seconds, but we realise that this potentially can lead to exhaustion of worker threads and cause unresponsiveness of Keycloak.
I tried multiple async combinations with HttpClient.sendAsync / Vertx.executeBlocking, but there is no luck because authenticate/action methods just return earlier than completable future ends which leads to errors in the flow.
Reactive approach gives much more flexibility and Keycloak behaves much better. I have managed to achieve the progress with custom implementation of RealmResourceProvider and @Suspended AsyncResponse asyncResponse.
However, we are not able to modify the contract of the Authenticator interface.
Is there any known way to offload this kind of operation to a separate thread pool to prevent from the problem with executor thread exhaustion?
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.
Uh oh!
There was an error while loading. Please reload this page.
Hi team!
We have a custom SPI that overrides the Authenticator interface. Our business case requires making an API call that sometimes can take up to 10 seconds. We realise that this is not a good approach, but we have no opportunities to change this behaviour because our team does not own this 3-rd party API.
We have updated client timeout to 10 seconds, but we realise that this potentially can lead to exhaustion of worker threads and cause unresponsiveness of Keycloak.
I tried multiple async combinations with
HttpClient.sendAsync/Vertx.executeBlocking, but there is no luck because authenticate/action methods just return earlier than completable future ends which leads to errors in the flow.Reactive approach gives much more flexibility and Keycloak behaves much better. I have managed to achieve the progress with custom implementation of
RealmResourceProviderand@Suspended AsyncResponse asyncResponse.However, we are not able to modify the contract of the Authenticator interface.
Is there any known way to offload this kind of operation to a separate thread pool to prevent from the problem with executor thread exhaustion?
All reactions