keycloak-nodejs-admin-client icon indicating copy to clipboard operation
keycloak-nodejs-admin-client copied to clipboard

Return all users with client role

Open d-vo opened this issue 4 years ago • 1 comments

Description

Hi everyone,

I want to use adminClient.clients.findUsersWithRole() to get all users that have a particular client role. However, I can only get the users to whom the role has been directly attached. I can not get users that inherit the role by being in a specific group that has this client role attached.

My workaround is to query all groups with the role attached with something like:

public findGroupsWithRole = this.makeRequest<{ id: string; roleName: string; first?: number; max?: number },
    GroupRepresentation[]>({
    method: 'GET',
    path: '/{id}/roles/{roleName}/groups',
    urlParamKeys: ['id', 'roleName'],
});

and then list all the members... or am I missing something here to get all the users with a particular client role?

Best regards and keep up the good work! Dominik

Discussion

No response

Motivation

No response

Details

No response

d-vo avatar Feb 01 '22 22:02 d-vo

As far as I am aware this API endpoint does not exist. If it does exist you should be able to find it in the Admin API documentation. If you want to request a new functionality in the API itself feel free to open up an issue on the main repository where this code resides.

jonkoops avatar Feb 02 '22 11:02 jonkoops