From b4650b7742c7f92a3c499a99cf25e9302e710cc5 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 16 Aug 2023 20:29:07 +0200 Subject: [PATCH] use logged in realm as default (#22460) --- .../org/keycloak/services/resources/admin/AdminConsole.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java index 23cf52d047..66d397524f 100644 --- a/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java +++ b/services/src/main/java/org/keycloak/services/resources/admin/AdminConsole.java @@ -231,7 +231,7 @@ public class AdminConsole { if (createRealmRole != null) { createRealm = user.hasRole(createRealmRole); } - addMasterRealmAccess(user, currentRealm, realmAccess); + addMasterRealmAccess(user, currentRealm != null ? currentRealm : realm.getName(), realmAccess); } else { logger.debug("setting up realm access for a realm user"); addRealmAccess(realm, user, realmAccess);