How to use a rest-client in keycloak 19 authenticators/required actions (Migration issue from v15)

Hi,

I’m currently in the process of migrating from keycloak 15 to 19 docker images (wildfly server to quarkus app). My project makes API calls to external api’s during the authentication process - I used org.jboss.resteasy:resteasy-client dependency 3.11.2.Final as a provided dependency to achieve this in keycloak versions 8 - 15. Having migrated to version 19 I’ve bumped the version of resteasy to 4.7.4.Final as that appears to be what is in keycloak 19’s pom: keycloak/pom.xml at main · keycloak/keycloak · GitHub.

I try instantiate an instance of the rest-client as follows:

new ResteasyClientBuilderImpl()
            .connectTimeout(X)
            .readTimeout(X)
            .connectionCheckoutTimeout(X)
            .providerFactory(ResteasyProviderFactory.getInstance())
            .useAsyncHttpEngine()
            .build();

However this results in an ERROR:

2022-10-25 10:38:40,740 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-6) Uncaught server error: java.lang.NoClassDefFoundError: org/jboss/resteasy/client/jaxrs/ResteasyClientBuilder
   at java.base/java.lang.ClassLoader.defineClass1(Native Method)
   at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
   at io.quarkus.bootstrap.runner.RunnerClassLoader.loadClass(RunnerClassLoader.java:97)
   at io.quarkus.bootstrap.runner.RunnerClassLoader.loadClass(RunnerClassLoader.java:57)

I have loaded the resteasy-client-4.7.4.Final.jar into the providers location within the docker container.

Thanks for any help,
Andy

Hi

Did you find a solution ?
I’m facing a similar problem…

-Peter