Skip to content

Instantly share code, notes, and snippets.

@dblevins
Forked from anonymous/get_color.sh
Created February 3, 2015 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblevins/ab9b4f5c461a6d67fbb2 to your computer and use it in GitHub Desktop.
Save dblevins/ab9b4f5c461a6d67fbb2 to your computer and use it in GitHub Desktop.
#!/bin/bash
STRING=$(echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | base64)
SIGNATURE=$(
echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | openssl dgst -binary -sha256 -hmac "PennyLunaLuka" | base64)
echo $SIGNATURE
curl -v \
-H "X-Signing-String: $STRING" \
-H 'Authorization: Signature keyId="kids",algorithm="hmac-sha256",headers="(request-target) date",signature="g+GNqWOXhigFV9ujbZN50J54HDeNZa1L4Bom+HIozqE="' \
-H 'Date: Tue, 07 Jun 2014 20:51:35 GMT' \
http://ec2-54-165-89-69.compute-1.amazonaws.com:8080/signature-prototype-1.0-SNAPSHOT/api/colors/preferred
curl -v \
-H "X-Signing-String: $STRING" \
-H "Authorization: Signature keyId=\"kids\",algorithm=\"hmac-sha256\",headers=\"(request-target) date\",signature=\"$SIGNATURE\"" \
-H 'Date: Tue, 07 Jun 2014 20:51:35 GMT' \
http://ec2-54-165-89-69.compute-1.amazonaws.com:8080/signature-prototype-1.0-SNAPSHOT/api/colors/preferred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment