Created
April 19, 2018 15:26
-
-
Save adam8810/82e98d34537816f93ce96d11f300b893 to your computer and use it in GitHub Desktop.
Copies a new JWT token to your clipboard
This file contains hidden or 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 | |
CLIENT_ID= # Add client id | |
CLIENT_SECRET= # Add client secret | |
AUTH_TOKEN_URL= # Add token url | |
AUDIENCE= # Add audience | |
curl --silent --request POST \ | |
--url $AUTH_TOKEN_URL \ | |
--header 'content-type: application/json' \ | |
--data "{\"client_id\":\"$CLIENT_ID\",\"client_secret\":\"$CLIENT_SECRET\",\"audience\":\"$AUDIENCE\",\"grant_type\":\"client_credentials\"}" 2>&1 | \ | |
grep -Eoi 'ey([^"]+)' | \ | |
pbcopy; \ | |
echo "Copied to clipboard" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment