Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
curl -sLO
tar xzf jwt-linux.tar.gz
curl -sLO
mv jq-linux64 jq
chmod +x jq
exp=$(date -d '10 minutes' +%s)
# If your machine doesn't have GNU date command, uncomment below
# exp=$(perl -e 'print time + 60*10')
JWT=$(./jwt encode --alg RS256 --exp $exp --iss $app_id --secret @$private_key_file)
curl -i -H "Authorization: Bearer $JWT"
curl -i -H "Authorization: Bearer $JWT"
curl -H "Authorization: Bearer $JWT" > installations.json
access_tokens_url=$(./jq -r '.[].access_tokens_url' installations.json)
curl -i -X POST -H "Authorization: Bearer $JWT" $access_tokens_url
curl -X POST -H "Authorization: Bearer $JWT" $access_tokens_url > access_tokens.json
access_token=$(./jq -r '.token' access_tokens.json)
curl -H "Authorization: token $access_token" | ./jq '.[].title'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment