summaryrefslogtreecommitdiff
path: root/script/02_authz_code_token_request
blob: 91bbcdb222774f0cea572207f769d3f0b6d77ef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e
cd "$(dirname "$0")/.."
HOST="${HOST:-http://localhost:8282}"

if [ $# -eq 0 ]; then
  echo "Usage:"
  echo "$0 <code>"
  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"