7

I´m using the official Keycloak API. I have a list of ids and would like to get all users represented by the ids. So let´s say i have a list with ids 1, 7, 9. Optimally i would would want to have a GET endpoint which accepts a list/array of ids as a PathVariable. But it seems like there´s no method like this. So i think i either have to send a seperate request for each id in the list and get the according user(which would result in n requests with a list of size n) or i have to get all users and filter them afterwards. Is there no better way?

M.Dietz
  • 900
  • 10
  • 29

2 Answers2

0

You can create your own Keycloak extension like this one: https://github.com/cloudtrust/keycloak-rest-api-extensions.

andrija
  • 1,057
  • 11
  • 21
0

Or as it is pointed out by @cyee in this question, some OAUTH providers recommend having a separate database with users' info. Of course, that requires creating a separate "auth-api" which would behave as middleware (updating a user would trigger an update of database).

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 28 '22 at 09:54