Custom SPI not working

Hello, I am trying to implement a custom SPI, however is not working properly.

This is the error I am getting

[org.keycloak.services] (default task-11) KC-SERVICES0013: Failed authentication: java.lang.RuntimeException: Unable to find factory for Required Action: CONFIGURE_SMS_OTP did you forget to declare it in a META-INF/services file?
	at org.keycloak.keycloak-services@13.0.1//org.keycloak.services.managers.AuthenticationManager.toRequiredActionFactory(AuthenticationManager.java:1327)

For the time being I am not doing anything special, just copying the default Browser flow and substitute the first Forms execution with my own SPI:

In the code I am simply wrapping the UsernameAndPassoword class

public class UsernamePasswordOrPhoneAuthenticator extends UsernamePasswordForm {

    @Override
    public void authenticate(AuthenticationFlowContext context) {
        super.authenticate(context);
    }

    @Override
    public void action(AuthenticationFlowContext context) {
        super.action(context);
    }
}
public class UsernamePasswordOrPhoneAuthenticatorFactory extends UsernamePasswordFormFactory {
    public static final String PROVIDER_ID = "phone-authenticator";
    public static final UsernamePasswordOrPhoneAuthenticator SINGLETON = new UsernamePasswordOrPhoneAuthenticator();

    @Override
    public Authenticator create(KeycloakSession session) {
        return SINGLETON;
    }

    @Override
    public String getId() {
        return PROVIDER_ID;
    }

    @Override
    public String getDisplayType() {
        return "Username Password Or Phone Form";
    }

    @Override
    public AuthenticationExecutionModel.Requirement[] getRequirementChoices() {
        return new AuthenticationExecutionModel.Requirement[]{
                AuthenticationExecutionModel.Requirement.REQUIRED,
        };
    }

    @Override
    public String getHelpText() {
        return "Validates a username and password or phone from login form.";
    }
}

Than I declare this as a service: com.gitlab.doctorworld.keycloakauthenticator.UsernamePasswordOrPhoneAuthenticatorFactory

This gets loaded correctly and is working, however after I click on login the application throws that error

I have even tried to remove the OTP part, but still the same error.

That’s it, that is all I am doing, however this is not working.

That error is about a missing RequiredAction. Are you also trying to declare a RequiredAction where the user sets up his phone? It looks like it is trying to find it, but it can’t.

That is what I though at the beginning, but unfortunately I am not, I have checked for any actions that require OTP or phone setup

Hello? We are still having that error

Hi! This one will be hard to debug for you without seeing your complete logs, configuration and the code for the custom required action (CONFIGURE_SMS_OTP is not part of Keycloak). My guess is that there is a problem loading one of the custom extensions, but it’s hard to tell without seeing more.