Search code examples
keycloakkeycloak-services

Keycloak: Not able to search system generated service account user in Users


Keycloak version: 20.0.3

Docker command: docker run --name keycloak -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:22.0.1 start-dev

Performed Steps :

  1. Login to keycloak.

  2. Create a new realm.

  3. create a client in Clients with name system_user_demo_service with config client authentication: On, Authorization: On and Authentication flow: Standard Flow, Direct access grants.

  4. Go to Users.

I can see a user got created with name service-account-system_user_demo_service. But when I am searching with this username, It is saying No search results`.


Solution

  • It is because it is not a user, it is a Client Service account and Keycloak hide them for security purpose.

    Documentation says :

    A client’s service account is a user account with username service-account-CLIENT_ID. You can perform the same user operations on this account as a regular account.