Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Oct 19, 2023
1 parent 87ecf82 commit b25d556
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions hack/jwt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# Usage: jwt.sh <key>
#
key=$1
hexKey=$(echo -n "${key}" \
| xxd -p \
| tr -d '\n')
header='{"alg":"HS512","typ":"JWT"}'
payload='{"scope":"applicaions:get","user":"operator"}'
headerStr=$(echo -n ${header} \
Expand All @@ -19,7 +16,7 @@ payloadStr=$(echo -n ${payload} \
| sed 's/\//_/g' \
| sed -E s/=+$//)
signStr=$(echo -n "${headerStr}.${payloadStr}" \
| openssl dgst -sha512 -mac HMAC -macopt hexkey:${hexKey} -binary \
| openssl dgst -sha512 -mac HMAC -macopt key:${key} -binary \
| base64 -w 0 \
| sed s/\+/-/g \
| sed 's/\//_/g' \
Expand Down

0 comments on commit b25d556

Please sign in to comment.