0

I am aware of this question especially this answer.

According to the documentation calling GET /{realm}/users gets you a UserRepresentation, which lists clientRoles as optional. That suggests, that it should be available in principle. But I do not know how I can leverage this.

I defined the endpoint as

const usersEndpoint = `${adminEndpoint}/realms/${realm}/users`;

Which should be correct. Or am I reading something wrong?

Thomas Junk
  • 5,588
  • 2
  • 30
  • 43

1 Answers1

0

I was thinking about it the wrong way. You are able to get a list of users having a role or a group by:

GET /{realm}/clients/{id}/roles/{role-name}/users

resp.

GET /{realm}/groups/{id}/members.

In order to get the list of every user having which roles, you could iterate over all roles and request their repective users and merge it.

Or in my way, retrieving the list of users having a discrete role was enough to achieve what I wanted.

Thomas Junk
  • 5,588
  • 2
  • 30
  • 43