summaryrefslogtreecommitdiff
path: root/bin/02_authz_code_token_request
diff options
context:
space:
mode:
Diffstat (limited to 'bin/02_authz_code_token_request')
-rwxr-xr-xbin/02_authz_code_token_request18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/02_authz_code_token_request b/bin/02_authz_code_token_request
new file mode 100755
index 0000000..91bbcdb
--- /dev/null
+++ b/bin/02_authz_code_token_request
@@ -0,0 +1,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"