-
-
Save ryanspletzer/c27da6c5517c2b8b20c166ee2427373d to your computer and use it in GitHub Desktop.
Keycloak Admin API Rest Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
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/admin/realms/master' \ | |
-H "Accept: application/json" \ | |
-H "Authorization: Bearer $TKN" | jq . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment