diff --git a/bin/get_token b/bin/get_token new file mode 100755 index 0000000..e35ddbb --- /dev/null +++ b/bin/get_token @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +function error_handler() { + >&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}." + exit "$2" +} +trap 'error_handler ${LINENO} $?' ERR +set -o errtrace -o errexit -o nounset -o pipefail + +username="${1:-nelson}" + +curl -s -X POST "localhost:8000/openid/token?code=${username}:this_is_not_secure_do_not_use_in_production" | jq -r .access_token