From 4075d65241012841563643e55b0f222547ef0e85 Mon Sep 17 00:00:00 2001 From: girirajsharma Date: Sat, 24 Oct 2015 22:09:27 +0530 Subject: [PATCH] [KEYCLOAK-1993] It's possible to create new authentication flow with empty name within another flow --- .../base/admin/resources/partials/create-flow-execution.html | 2 +- .../resources/admin/AuthenticationManagementResource.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html index e884ef8630..e29eef417d 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/create-flow-execution.html @@ -7,7 +7,7 @@
- +
Specifies display name for the flow.
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 063e66c272..0da9a45cae 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 @@ -276,6 +276,10 @@ public class AuthenticationManagementResource { @Consumes(MediaType.APPLICATION_JSON) public Response createFlow(AuthenticationFlowModel model) { this.auth.requireManage(); + + if (model.getAlias() == null || model.getAlias().isEmpty()) { + return ErrorResponse.exists("Failed to create flow with empty alias name"); + } if (realm.getFlowByAlias(model.getAlias()) != null) { return ErrorResponse.exists("Flow " + model.getAlias() + " already exists");