From 350a9cd997e5289be58a7ddc77d7f4a7478f8d26 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 12 Apr 2016 08:04:06 +0200 Subject: [PATCH] KEYCLOAK-2803 Fix failure to add execution to client flow --- .../resources/admin/AuthenticationManagementResource.java | 8 +++++++- .../base/admin/resources/partials/create-execution.html | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java index 54378bf181..1e42aad8bf 100755 --- a/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AuthenticationManagementResource.java @@ -389,10 +389,16 @@ public class AuthenticationManagementResource { String provider = data.get("provider"); // make sure provider is one of the registered providers - ProviderFactory f = session.getKeycloakSessionFactory().getProviderFactory(Authenticator.class, provider); + ProviderFactory f; + if (parentFlow.getProviderId().equals(AuthenticationFlow.CLIENT_FLOW)) { + f = session.getKeycloakSessionFactory().getProviderFactory(ClientAuthenticator.class, provider); + } else { + f = session.getKeycloakSessionFactory().getProviderFactory(Authenticator.class, provider); + } if (f == null) { throw new BadRequestException("No authentication provider found for id: " + provider); } + AuthenticationExecutionModel execution = new AuthenticationExecutionModel(); execution.setParentFlow(parentFlow.getId()); execution.setRequirement(AuthenticationExecutionModel.Requirement.DISABLED); diff --git a/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html b/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html index 6956088ab5..dd333a9269 100755 --- a/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html +++ b/themes/src/main/resources/theme/base/admin/resources/partials/create-execution.html @@ -1,6 +1,8 @@
+

{{:: 'create-authenticator-execution' | translate}}

+

{{:: 'create-authenticator-execution' | translate}}

{{:: 'create-form-action-execution' | translate}}