You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to find a group by path in using @keycloak/keycloak-admin-client?
#36755
We are leverage the notion of subgroups in Keycloak so that groups are grouped together under a group for given application. For example, myapp/group1.
We are trying to see if there is a way to find a group matching the path /myapp/group1, by doing only one call?
Right now we are need to find the myapp group and then return all the child groups, and then locally look for a matching group. This doesn't feel very optimal.
constparts=path.split('/');constlimit=1000;// find the base groupconstgroups=awaitkcAdminClient.groups.find({search: parts[], briefRepresentation,max: 200});constbaseGroup=groups.find(group=>group.name===parts[]);// find the groupif(baseGroup){constkcAdminClient=awaitthis.accessContext();groups=awaitkcAdminClient.groups.listSubGroups({parentId: baseGroup.id,first: options.offset,max: limit});returngroups.find(group=>group.name===parts[1]);}
If anyone can suggest a more optimal solution, I'd be interested.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We are leverage the notion of subgroups in Keycloak so that groups are grouped together under a group for given application. For example,
myapp/group1.We are trying to see if there is a way to find a group matching the path
/myapp/group1, by doing only one call?Right now we are need to find the
myappgroup and then return all the child groups, and then locally look for a matching group. This doesn't feel very optimal.If anyone can suggest a more optimal solution, I'd be interested.
All reactions