I’m implementing a Keycloak authentication provider (for Keycloak 6.0.1) which returns a message when a user is temporarily locked (like specified at Keycloak Custom message on user temporary lock)
When I do mvn clean install wildfly:deploy
I get :
[ERROR] Caused by: java.util.ServiceConfigurationError: org.keycloak.authentication.AuthenticatorFactory: Provider com.mumba.cloud.authenticator.LockedUserAuthenticatorFactory could not be instantiated
[ERROR] Caused by: java.lang.NoClassDefFoundError: Failed to link com/mumba/cloud/authenticator/LockedUserAuthenticator (Module \"deployment.lockeduser-authenticator-1.0-SNAPSHOT.jar\" from Service Module Loader): org/keycloak/authentication/authenticators/browser/UsernamePasswordForm"}}}}
I’m looking for some help on how to track down why I’m getting the java.lang.NoClassDefFoundError and why Maven (or maybe it’s wildfly) can’t seem to find org/keycloak/authentication/authenticators/browser/UsernamePasswordForm
It isn’t a compile-time error, and I believe my import statement below is correct for UsernamePasswordForm (see code below).
I also think I have correctly added the dependency (keycloak-services) to my pom.xml (see below).
I’m very new to Maven (and Java/Keycloak development), so I’m not sure where to dig to track this down.
Anyone have any pointers?
package com.mumba.cloud.authenticator;
import org.keycloak.authentication.authenticators.browser.UsernamePasswordForm;
public class LockedUserAuthenticator extends UsernamePasswordForm {
@Override
protected String tempDisabledError() {
return "ACCOUNT IS temporarily disabled.";
}
}
My pom.xml includes :
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<keycloak-version>6.0.1</keycloak-version>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>${keycloak-version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<version>${keycloak-version}</version>
</dependency>
...