Re: [gs-discussion] curl signature headache

456 views
Skip to first unread message

Google Cloud Storage Team

unread,
Mar 25, 2013, 7:20:56 PM3/25/13
to gs-discussion
Hi Amir,

I must admit that I am impressed you're doing URL signing in shell script.  While this should be possible, have you considered simply using the gsutil tool or a client library to interact with cloud storage?  What is the ultimate goal you're trying to accomplish?  

If you're dead set on using curl to interact with the service, it might be easiest to use the signed URL example code to generate the URL, and then utilize the generated URL with curl.  

Best Regards,
Benson
Google Cloud Storage Team 


On Mon, Mar 25, 2013 at 2:15 PM, Amir Hayek <free...@gmail.com> wrote:
hi, i am trying to access my google cloud storage through apis with curl. here is what i am doing in the reminal (osx) :

ACCESS_KEY="my key here"
SECRET_KEY="my secret here"
VERB=GET
CHECKSUM=""
CONTENT_TYPE=""
URI=""
DATE="$(date)"
stringtosign="$VERB\n$CHECKSUM\n$CONTENT_TYPE\n$DATE\n${URI}"
echo $stringtosign
AUTHORIZATION="GOOG1 $ACCESS_KEY:$(echo -ne "$stringtosign" | openssl dgst -sha1 -hmac "$SECRET_KEY" -binary | openssl base64)"
echo $AUTHORIZATION
curl -X $VERB http://commondatastorage.googleapis.com$URI -i -v -H Content-Length:0 -H "Authorization:$AUTHORIZATION" -H "Date:$DATE"


and i am getting SignatureDoesNotMatch , The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.

the whole day i tried many other variations and i still get the same problem. i double checked the access keys and i dont know where else to look.

please help :(

--
You received this message because you are subscribed to the Google Groups "Google Cloud Storage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gs-discussio...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joshua

unread,
Mar 26, 2013, 1:23:35 PM3/26/13
to gs-dis...@googlegroups.com
Hi Amir,

The response body should contain an XML error response which should have the string we expected you to have signed in it.  You can compare that to the string you actually signed in order to figure out what is wrong with the string you are constructing.  If the strings are identical then the problem is probably in the signing mechanism.

Hope that helps,
-Josh


On Tue, Mar 26, 2013 at 12:21 AM, Amir Hayek <free...@gmail.com> wrote:
i want to write an ios and osx apps that uses the cloud storage, no client library exist for them. i am starting to think to use other services instead.
for some reason even the python script didnt work (i got 503) 

thank you anyway 
Reply all
Reply to author
Forward
0 new messages