# HG changeset patch # User Kim Alvefur # Date 1683484895 -7200 # Node ID 48c643c851f3a6465ec7ef85f083f611a5d8e128 # Parent 0bbeee8ba8b5f8f9efe503a60a8e1a003de43984 mod_rest/rest.sh: Make scopes to request configurable in restrc Makes it easier to experiment with requesting various scopes and roles diff -r 0bbeee8ba8b5 -r 48c643c851f3 mod_rest/example/rest.sh --- a/mod_rest/example/rest.sh Sun May 07 20:25:18 2023 +0200 +++ b/mod_rest/example/rest.sh Sun May 07 20:41:35 2023 +0200 @@ -89,7 +89,7 @@ if [ -z "${ACCESS_TOKEN:-}" ]; then CODE_CHALLENGE="$(head -c 33 /dev/urandom | base64 | tr /+ _-)" - open "$AUTHORIZATION_ENDPOINT?response_type=code&client_id=$CLIENT_ID&code_challenge=$CODE_CHALLENGE&scope=openid+prosody:user" + open "$AUTHORIZATION_ENDPOINT?response_type=code&client_id=$CLIENT_ID&code_challenge=$CODE_CHALLENGE&scope=${SCOPE:-openid+prosody:user}" read -p "Paste authorization code: " -s -r AUTHORIZATION_CODE TOKEN_RESPONSE="$(http --check-status --form "$TOKEN_ENDPOINT" 'grant_type=authorization_code' "client_id=$CLIENT_ID" "client_secret=$CLIENT_SECRET" "code=$AUTHORIZATION_CODE" code_verifier="$CODE_CHALLENGE")"