From a6b7842ff4196901225c82b8bf4a4117a2197290 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 14 Apr 2022 10:19:55 -0600 Subject: update bin scripts to accept a target host --- src/oidc/bin/00_metadata | 5 +++-- src/oidc/bin/01_authz_code | 3 ++- src/oidc/bin/02_authz_code_token_request | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/oidc/bin/00_metadata b/src/oidc/bin/00_metadata index 857fa40..7d57dad 100755 --- a/src/oidc/bin/00_metadata +++ b/src/oidc/bin/00_metadata @@ -2,6 +2,7 @@ set -e cd "$(dirname "$0")/.." +HOST="${HOST:-http://localhost:8282}" -curl -s "http://localhost:8282/.well-known/openid-configuration" | jq '.' -curl -s "http://localhost:8282/.well-known/jwks.json" | jq '.' +curl -s "${HOST}/.well-known/openid-configuration" | jq '.' +curl -s "${HOST}/.well-known/jwks.json" | jq '.' diff --git a/src/oidc/bin/01_authz_code b/src/oidc/bin/01_authz_code index a3fadd4..3f6c44b 100755 --- a/src/oidc/bin/01_authz_code +++ b/src/oidc/bin/01_authz_code @@ -2,5 +2,6 @@ set -e cd "$(dirname "$0")/.." +HOST="${HOST:-http://localhost:8282}" -curl -s "http://localhost:8282/authorize?response_type=code&scope=openid&client_id=f00d&state=potatoe&redirect_uri=http://example.org/callback" +curl -s "${HOST}/authorize?response_type=code&scope=openid&client_id=client_id&state=potatoe&redirect_uri=http://example.org/callback" diff --git a/src/oidc/bin/02_authz_code_token_request b/src/oidc/bin/02_authz_code_token_request index e832701..91bbcdb 100755 --- a/src/oidc/bin/02_authz_code_token_request +++ b/src/oidc/bin/02_authz_code_token_request @@ -2,6 +2,7 @@ set -e cd "$(dirname "$0")/.." +HOST="${HOST:-http://localhost:8282}" if [ $# -eq 0 ]; then echo "Usage:" @@ -10,9 +11,8 @@ if [ $# -eq 0 ]; then fi CODE="${1}" - curl -s \ -u "client_id:client_secret" \ --basic \ -d "grant_type=authorization_code&code=${CODE}&redirect_uri=http://example.org/callback" \ - "http://localhost:8282/token" + "${HOST}/token" -- cgit v1.2.3