-
-
Save dblevins/ab9b4f5c461a6d67fbb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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