summaryrefslogtreecommitdiff
path: root/bin/02_authz_code_token_request
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2022-04-22 14:40:41 -0600
committermo khan <mo@mokhan.ca>2022-04-22 14:40:41 -0600
commitfb0451985da0574a02a339d2d8dabcf0477ce425 (patch)
tree31dc3ff1c811679202bf19c30eee05fbaf0af3fe /bin/02_authz_code_token_request
parent0815655919005dac35cee091f7144639f51334ce (diff)
embed insecure private key
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"