Skip to content

Instantly share code, notes, and snippets.

@adixchen
Last active August 31, 2021 14:14
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save adixchen/ca2c2193172068724f86dde91081e317 to your computer and use it in GitHub Desktop.
Save adixchen/ca2c2193172068724f86dde91081e317 to your computer and use it in GitHub Desktop.
Get Keycloak access token via curl and pretty print it with python
curl \
-d 'client_id=YOUR_KEYCLOAK_CLIENT' \
-d 'username=YOUR_USERNAME' \
-d 'password=YOUR_PASSWORD' \
-d 'grant_type=password' \
'https://YOUR_KEYCLOAK_SERVER_HOST/auth/realms/YOUR_REALM/protocol/openid-connect/token' \
| python -m json.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment