[keycloak-user] Keycloak Database & Authenticator

Marten Krings Marten.Krings at topicus.nl
Thu Dec 21 07:36:02 EST 2017


Hello,

I'm trying to create a custom authenticator, however I'm running into some problems retrieving data from Keycloak's database.

I've built a Jpa entity provider according to this example:
https://github.com/keycloak/keycloak/tree/master/examples/providers/domain-extension/src/main/java/org/keycloak/examples/domainextension/jpa

I've deployed this as a module according to the instructions provided with the example.
This part works wonderfully, and the new table appears in my database.

I've also tried implementing a serviceprovider, according to the same example as previously, I could deploy this, however when I try to get the provider at runtime in a custom authenticator with:

KeycloakSession.getProvider(ServiceProvider.class)

the keycloak installation returns a java.lang.NoClassDefFoundError.

KeycloakSession.getAllProviders(JpaEntityProvider.class) returns a HashSet containing 1 element, namely the desired provider, however this "Class has no fields". trying to do anything further using this object results in the above exception.

What am I doing wrong here?

Thanks,

Marten Krings


More information about the keycloak-user mailing list