Keycloak 1.9.1-FinalWie kann ich eine benutzerdefinierte FormAction in Keycloak korrekt registrieren?
Ich habe die folgende benutzerdefinierte FormActionFactory implementiert.
public class RegistrationFormActionFactory implements FormActionFactory{
public static final String PROVIDER_ID = "rc-registration-profile-action";
@Override
public FormAction create(KeycloakSession session){
return new RegistrationFormAction();
}
@Override
public String getDisplayType(){
return "RC Profile Validation";
}
...
und die damit verbundene Formaction nach dem Vorbild org.keycloak.authentication.forms.RegistrationProfile
public class RegistrationFormAction implements FormAction{
...
in META-INF/service des Kruges ich eine Datei habe: org.keycloak.authentication.FormActionFactory
enthält nur der folgende Text:
com.realcomp.keycloak.RegistrationFormActionFactory
Innerhalb der Keycloak Admin-Seiten habe ich eine Kopie des Registrierungs- Authentifizierungsablaufs erstellt und es Kopie der Registrierung genannt. Beim Hinzufügen einer Ausführung zu meinem neuen Fluss sehe ich meine benutzerdefinierte "RC Profil Validierung" FormAction in der Dropdown-Liste der verfügbaren Anbieter. Wenn diese Option aktiviert, erhalte ich die folgende Ausnahme in den Keycloak Server-Logs:
14:31:00,264 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-54) RESTEASY002005: Failed executing POST /admin/realms/master/authentication/flows/Copy of registration registration form/executions/execution: org.jboss.resteasy.spi.BadRequestException: No authentication provider found for id: rc-registration-profile-action
at org.keycloak.services.resources.admin.AuthenticationManagementResource.addExecution(AuthenticationManagementResource.java:394)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
(omitted...)
Interessante Randnotiz: Wenn ich die PROVIDER_ID in meinem FormActionFactory ändern wie erwartet "registration-profile-Aktion" alles funktioniert. Diese PROVIDER_ID wird jedoch von der RegistrationProfile-Klasse verwendet und fühlt sich falsch an.
Ich erhöhte Protokollausführlichkeit und es scheint, meine Formaction ist geladen:
17:07:20,659 DEBUG [org.keycloak.services] (ServerService Thread Pool -- 50) Loaded SPI form-action (providers = [registration-profile-action, rc-registration-profile-action, registration-recaptcha-action, registration-password-action, registration-user-creation])
Ich habe einige Konfigurationsschritt wahrscheinlich verpasst. Irgendwelche Ideen, was ich hier falsch gemacht habe?