comparison mod_rest/example/rest.sh @ 5380:822d26271d9f

mod_rest/rest.sh: Set software_id in client registration to something Mostly just for exercising the extra fields.
author Kim Alvefur <zash@zash.se>
date Thu, 27 Apr 2023 20:56:24 +0200
parents 36d40f5b81fe
children e3fc52b40064
comparison
equal deleted inserted replaced
5379:36d40f5b81fe 5380:822d26271d9f
69 TOKEN_ENDPOINT="$(echo "$OAUTH_META" | jq -e -r '.token_endpoint')" 69 TOKEN_ENDPOINT="$(echo "$OAUTH_META" | jq -e -r '.token_endpoint')"
70 70
71 if [ -z "${OAUTH_CLIENT_INFO:-}" ]; then 71 if [ -z "${OAUTH_CLIENT_INFO:-}" ]; then
72 # Register a new OAuth client 72 # Register a new OAuth client
73 REGISTRATION_ENDPOINT="$(echo "$OAUTH_META" | jq -e -r '.registration_endpoint')" 73 REGISTRATION_ENDPOINT="$(echo "$OAUTH_META" | jq -e -r '.registration_endpoint')"
74 OAUTH_CLIENT_INFO="$(http --check-status "$REGISTRATION_ENDPOINT" Content-Type:application/json Accept:application/json client_name=rest.sh client_uri="https://modules.prosody.im/mod_rest" application_type=native redirect_uris:='["urn:ietf:wg:oauth:2.0:oob"]')" 74 OAUTH_CLIENT_INFO="$(http --check-status "$REGISTRATION_ENDPOINT" Content-Type:application/json Accept:application/json client_name=rest.sh client_uri="https://modules.prosody.im/mod_rest" application_type=native software_id=0bdb0eb9-18e8-43af-a7f6-bd26613374c0 redirect_uris:='["urn:ietf:wg:oauth:2.0:oob"]')"
75 mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/rest/" 75 mkdir -p "${XDG_CACHE_HOME:-$HOME/.cache}/rest/"
76 typeset -p OAUTH_CLIENT_INFO >> "${XDG_CACHE_HOME:-$HOME/.cache}/rest/$HOST" 76 typeset -p OAUTH_CLIENT_INFO >> "${XDG_CACHE_HOME:-$HOME/.cache}/rest/$HOST"
77 fi 77 fi
78 78
79 CLIENT_ID="$(echo "$OAUTH_CLIENT_INFO" | jq -e -r '.client_id')" 79 CLIENT_ID="$(echo "$OAUTH_CLIENT_INFO" | jq -e -r '.client_id')"