Created
February 2, 2015 23:52
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 -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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ 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
g+GNqWOXhigFV9ujbZN50J54HDeNZa1L4Bom+HIozqE=