Search code examples
phpsymfonykeycloakkeycloak-rest-api

Keycloak- get all users by client


I was investigating the Keycloak documentation.

I am not able to find one endpoint that I need. In my Symfony project so far I have made to:

  1. get an access token
  2. extract the access token
  3. Use it to get userId if needed

What I could not find is an endpoint from which I could list users who have authorized a given clientId . Does that endpoint exists?

If not, what is the best approach to accomplish this?

NOTE: We are still using Keycloak version 5.


Solution

  • What I could not find is an endpoint from which I could get all users by cliendId . Does that endpoint exists?

    No, such endpoint does not exist because (in Keycloak) users are defined at the Realm Level, hence tight to a given realm, not to a given client. The clients are the conceptual representation of things such as applications that users of a certain realm can use to (for instance) request tokens.