main
 1#!/bin/sh
 2
 3set -e
 4cd "$(dirname "$0")/.."
 5HOST="${HOST:-http://localhost:8282}"
 6
 7if [ $# -eq 0 ]; then
 8  echo "Usage:"
 9  echo "$0 <code>"
10  exit 1
11fi
12
13CODE="${1}"
14curl -s \
15  -u "client_id:client_secret" \
16  --basic \
17  -d "grant_type=authorization_code&code=${CODE}&redirect_uri=http://example.org/callback" \
18  "${HOST}/token"