Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -ef
- # dont put slash at the end or that would fail
- URL=""
- TOKEN=$(curl -f -k -s -k "${URL}/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'|python -c 'import sys, json; print json.load(sys.stdin)["access_token"]')
- curl -f -s -k "${URL}/auth/admin/realms" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" | python -mjson.tool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement