I have implemented a custom REST endpoint in KeyCloak 9.0.3. This endpoint will be invoked by an external UI layer to complete the entire registration flow including creating the user and sending the verification flow. In the SPI code, I am invoking the Admin REST client to create the user and send the verification email. I get an error when I invoke this service.
ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-42) Uncaught server error: java.lang.NoClassDefFoundError: org/keycloak/admin/client/KeycloakBuilder
My POM file has the dependency included -
<dependency> <groupId>org.keycloak</groupId> <artifactId>keycloak-admin-client</artifactId> </dependency>
I have tried adding a provided depenency as well but no luck.
Any ideas on what I am missing here? Or is there a problem with accessing the Admin REST API from within a custom SPI?