#!/bin/sh set -e cd "$(dirname "$0")/.." HOST="${HOST:-http://localhost:8282}" if [ $# -eq 0 ]; then echo "Usage:" echo "$0 " exit 1 fi CODE="${1}" curl -s \ -u "client_id:client_secret" \ --basic \ -d "grant_type=authorization_code&code=${CODE}&redirect_uri=http://example.org/callback" \ "${HOST}/token"