Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Keycloak Admin API Rest Example
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=admin" \
-d 'password=admin' \
-d 'grant_type=password' \
-d 'client_id=admin-cli' | jq -r '.access_token')
curl -X GET 'http://localhost:8080/auth/admin/realms' \
-H "Accept: application/json" \
-H "Authorization: Bearer $TKN" | jq .
Copy link

mssaisandeep commented Nov 20, 2019

Any update on this? I am also struggling

Copy link

evasyuk commented Nov 26, 2019

@mssaisandeep most probably you need to use correct service account with admin-role. Please, start with digging deeper into

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment