From fbdaf03972bdc66c0ad55e8aa67ca9114f3ab420 Mon Sep 17 00:00:00 2001 From: vramik Date: Sun, 12 May 2024 13:44:34 +0200 Subject: [PATCH] Ensure master realm can't be removed Fixes #28896 Signed-off-by: vramik --- .../keycloak/services/resources/admin/RealmAdminResource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java index cb4f64cc20..42222e5fa2 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/RealmAdminResource.java @@ -486,7 +486,7 @@ public class RealmAdminResource { auth.realm().requireManageRealm(); if (Config.getAdminRealm().equals(realm.getName())) { - throw ErrorResponse.error("Can't rename master realm", Status.BAD_REQUEST); + throw ErrorResponse.error("Can't remove master realm", Status.BAD_REQUEST); } if (!new RealmManager(session).removeRealm(realm)) {