1
votes

i want to read all Users from a realm via rest api and postman. If I send http://localhost:8080/realms/{realm}/users i get no response. Does anyone know a tutorial on how to use the api? I also want to add users, which does not work with the api. I read the keycloak api description, but I don’t understand what I have todo.

Thx

2

2 Answers

1
votes

The official documentation does not describe it very accurately. You can try this api

http://localhost:8080/auth/admin/realms/{realm}/users

add "auth/admin" after your host address. Access to this api requires admin access_token.

0
votes

The process of getting an access to Keycloak REST API is described in the Server Development Guide - Admin REST API. https://www.keycloak.org/docs/latest/server_development/index.html#admin-rest-api

You need first to obtain an access token from Master realm and then using this access token submit a request to realm you want to get users from.

Make sure to use "client_id=admin-cli" parameter when requesting the access token from Master realm.