Last active
May 29, 2019 13:31
-
-
Save mriedmann/acd909b77b4f44f09e8cf4d753c997ad to your computer and use it in GitHub Desktop.
Test Keycloak with Linux CLI
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 | |
PROTO=http | |
#PROTO=https | |
HOST=172.17.0.3:8080 | |
HOST_HEADER=test.blub | |
PROTO_HEADER=http | |
#HOST=kc-test.loopback | |
JWT=$(curl -k \ | |
-H "Host: $HOST_HEADER" \ | |
-H "X-Forwarded-Proto: $PROTO_HEADER" \ | |
-d 'client_id=test' \ | |
-d 'username=admin' \ | |
-d 'password=admin' \ | |
-d 'grant_type=password' \ | |
"$PROTO://$HOST/auth/realms/master/protocol/openid-connect/token" | jq -r '.access_token') | |
echo $JWT | cut -d. -f 2 | base64 -d | jq -r '.iss' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment