I try to use Blob Service REST API, List Containers (REST API):
http://msdn.microsoft.com/en-us/library/windowsazure/dd179352.aspx
So I get access keys from Management Portal->Hosted Services, Storage Accounts & CDN -> Storage Accounts, where I selected my storage (aziztest) and get keys from View Access Keys:
there are 2 keys Primary and Secondary.
Then using I created String to Sign:
GET\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:Wed, 29 Feb 2012 06:05:13 GMT\nx-ms-version:2009-09-19\n/aziztest\ncomp:list
and make Authorization header using Primary Access Key of my storage:
Authorization: SharedKey aziztest:OjfrOTuO4zy1oUWGHkw8uj3%2BgAZq33GWe15gPT/PK%2Bk%3D
And then make GET request to:
http://aziztest.blob.core.windows.net/?comp=list
But I get an error:
AuthenticationFailedServer failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:892d1f31-a20d-45a5-b16a-2f7c07519863\nTime:2012-02-29T00:02:44.2841133ZRequest date header not specified
What is wrong in my procedure?
What you’ve done seems pretty good, I presume you’re following the instructions on MSDN on how to create the authentication header? I can see you’ve used them in the string which you are signing, but have you included
x-ms-dateandx-ms-versionactually in your request header? The error message would indicate you haven’t.