diff options
| author | mo khan <mo@mokhan.ca> | 2022-04-13 21:20:00 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2022-04-13 21:20:00 -0600 |
| commit | 2cdcbf277d7c8ae5f8fa38588b6c2b96dcf0eabc (patch) | |
| tree | 0b415bb8e2e37d5d8e9ffb87d29abac0fd26641e /src/oidc | |
| parent | 4c279789b1958f1be5c0cab18b96292309cd0c15 (diff) | |
accept authorization code as a parameter
Diffstat (limited to 'src/oidc')
| -rwxr-xr-x | src/oidc/bin/01_authz_code | 2 | ||||
| -rwxr-xr-x | src/oidc/bin/02_authz_code_token_request | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/oidc/bin/01_authz_code b/src/oidc/bin/01_authz_code index 80fb250..a3fadd4 100755 --- a/src/oidc/bin/01_authz_code +++ b/src/oidc/bin/01_authz_code @@ -3,4 +3,4 @@ set -e cd "$(dirname "$0")/.." -curl -v -s "http://localhost:8282/authorize?response_type=code&scope=openid&client_id=f00d&state=potatoe&redirect_uri=http://example.org/callback" +curl -s "http://localhost:8282/authorize?response_type=code&scope=openid&client_id=f00d&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 65a8ab8..e832701 100755 --- a/src/oidc/bin/02_authz_code_token_request +++ b/src/oidc/bin/02_authz_code_token_request @@ -3,8 +3,16 @@ set -e cd "$(dirname "$0")/.." +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=ad2bcbc1-b61b-47bf-80a2-13882f6f6eab&redirect_uri=http://example.org/callback" \ + -d "grant_type=authorization_code&code=${CODE}&redirect_uri=http://example.org/callback" \ "http://localhost:8282/token" |
