RealmResourceProvider endpoint gives me a 404 when I deploy as a war


I wrote a simple spi to do my otp config. When I deploy it as a jar and call the endpoint and call the url auth/realms/{{myream}}/OTPConfig/otp/{{myusername}}

It finds this endpoint but I fail as I am missing dependencies in my jar

ie I get

Caused by: java.lang.ClassNotFoundException: org.keycloak.utils.TotpUtils from [Module "deployment.otp-config-spi-1.0-SNAPSHOT.jar" from Service Module Loader]

I then packaged it as a war including the dependencies and it says its deploy successfully but now the endpoint gives me a 404

What am I doing wrong?

Same issue. Did you manage to solve it?


I went back to using a jar. Use gradle or maven and add your dependencies into the jar and ensure you add keycloak-services to the manifest and it all works