get token script for built-in nonprod openid

This commit is contained in:
burnettk 2024-03-27 13:11:55 -04:00
parent 9b37fdb91c
commit 510144fd6c
No known key found for this signature in database
1 changed files with 12 additions and 0 deletions

12
bin/get_token Executable file
View File

@ -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