From 0a85c532ee388f4c0fe2b6d97d87b309a45f7358 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 1 Mar 2023 19:20:52 +0100 Subject: [PATCH] don't include service accounts in search results (#17189) fixes: #8849 --- .../org/keycloak/admin/ui/rest/BruteForceUsersResource.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java index 8131865990..dc7deaec5e 100644 --- a/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java +++ b/rest/admin-ui-ext/src/main/java/org/keycloak/admin/ui/rest/BruteForceUsersResource.java @@ -8,7 +8,6 @@ import java.util.stream.Stream; import javax.ws.rs.Consumes; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; -import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import org.eclipse.microprofile.openapi.annotations.Operation; @@ -143,7 +142,7 @@ public class BruteForceUsersResource { } private Stream searchForUser(Map attributes, RealmModel realm, UserPermissionEvaluator usersEvaluator, Boolean briefRepresentation, Integer firstResult, Integer maxResults, Boolean includeServiceAccounts) { - session.setAttribute(UserModel.INCLUDE_SERVICE_ACCOUNT, includeServiceAccounts); + attributes.put(UserModel.INCLUDE_SERVICE_ACCOUNT, includeServiceAccounts.toString()); if (!auth.users().canView()) { Set groupModels = auth.groups().getGroupsWithViewPermission();