星期五, 1月 16, 2009

Azure authorization

In MSDN Azure Authentication Schemes

http://msdn.microsoft.com/en-us/library/dd179428.aspx

Blob and Queue Storage (Shared Key Authentication)

signature example :

"PUT\n\ntext/plain; charset=UTF-8\n\nx-ms-Date:Wed, 17 Sep 2008 20:36:40 GMT\nx-ms-meta-m1:v1\nx-ms-meta-m2:v2\n/testaccount1/storageclientcontainer/hello.txt"


But it not works!!!

-------------------------------------------------------------------------------

In Sergei Meleshchuk's blog

Request authorization in Azure SDK
http://blogs.msdn.com/sergeim/archive/2008/12/10/request-authorization-in-azure-sdk.aspx

The resulting signature string looks like below.

"GET\n\n\n\nx-ms-date:Mon, 01 Dec 2008 05:17:57 GMT\n/accountname/queuename/messages"

And it works...

------------------------------------------------------------------------

The root cause is the "x-ms-date" and "x-ms-Date" are different after HMACSHA256