[keycloak-user] Use keycloak classes from a custom Authenticator: NoClassDefFoundError

Christophe de Vienne christophe.devienne at orus.io
Wed Sep 4 05:32:20 EDT 2019


Hi everyone,

I want to write a custom Authenticator that borrow code from
AbstractIdpAuthenticator (or better, extends it).

However, as soon as my authenticator attempts to load a class from the
keycloak-services package, I get a NoClassDefFoundError. For example:

08:24:53,608 ERROR [org.keycloak.services.error.KeycloakErrorHandler]
(default task-6) Uncaught server error: java.lang.NoClassDefFoundError:
org/keycloak/authentication/authenticators/broker/util/SerializedBrokeredIdentityContext

I used the authenticator example provided in the examples directory as a
base for writing the pom.xml file.

Should I be able to use or extend keycloak classes from within my
provider (packaged as a jar, I also tried wildfly:deploy)?

If so, what am I missing?

I also posted a question on stackoverflow, you may find some relevant
detail in it:
https://stackoverflow.com/questions/57778240/noclassdeffounderror-in-a-provider-jar-when-using-a-class-from-org-keycloak-auth

Thanks,

Christophe


More information about the keycloak-user mailing list