Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

Sep 4, 2009 at 9:11 AM
Edited Sep 4, 2009 at 9:13 AM

Hi All I am trying to talk to the Azure I am getting above error.

Below are my HEaders

0= x-ms-version: 2009-04-14
1= x-ms-date: Fri, 04 Sep 2009 09:06:16 GMT
2= Authorization: SharedKey ssdcdata:NVFHMOQOzPMoDzMqn+QbrK+ZbJk0V0lqNHU759u1UXo=
3= Content-Length: 0
4= Content-Type:
5= Expect:

Coordinator
Sep 4, 2009 at 11:14 AM

Can you provide more details on this? The request URL, parameters, code used to create the request, ...

Sep 4, 2009 at 12:12 PM

Please check the below code

<?php

require_once 'Microsoft/Azure/Storage/Table.php';

require_once 'Microsoft/Azure/RetryPolicy.php';
define('TESTS_Table_HOST', 'table.core.windows.net/');

define('TESTS_STORAGE_ACCOUNT', "XXXXXXX");
define('TESTS_STORAGE_KEY',     "zszLxdXM/ZA2ELYCkuCBiuYbmDeVszTOOKhS1R9Q/zuQ8QIBbIVecpwPET9LI1cTuUPZzMinWUo/FTve8oS3fw==");
try
{
 $storageClient = new Microsoft_Azure_Storage_Table(TESTS_Table_HOST, TESTS_STORAGE_ACCOUNT, TESTS_STORAGE_KEY, false, Microsoft_Azure_RetryPolicy::retryN(2,250));
 $containerresult =$storageClient->listTables();
 if(empty($containerresult))
 {
  echo "<b>&nbsp; Container list is empty </b>" . "<br/><br/>";
 }
 else
 {
  echo var_dump($containerresult) . "<br/><br/>";
 }
}
catch(Exception $ex)
{
echo "<font color=red><b>&nbsp;!! ERROR : </font></b>" . $ex->getMessage(). "<br/><br/>";
}
?>

Coordinator
Sep 4, 2009 at 12:30 PM

In the authorization header, I see you are using SharedKey auth. Can you switch this over to SharedKeyLite?

Sep 7, 2009 at 3:52 AM

HI Maartenba,

Still I am facing problem in creating headers using PHP SDK Azure Can you provide me what and all headers has to pass to the url.

Coordinator
Sep 7, 2009 at 6:06 AM

Can you make sure the account name and account key are correct? I tried the ones in your examples above and got the same error message. After trying other account/key combination, it gives no problems.

Sep 7, 2009 at 7:30 AM

can you share me the source code what you tried please,

Coordinator
Sep 7, 2009 at 10:54 AM

I tried exactly your code on the latest source code commit, using my personal account + key. 

Sep 7, 2009 at 2:23 PM

HI maartenba,

I have checked my credentials even though I am getting 403 Forbidden http error, please give me the headers what and all  headers has to be pass.

Sep 8, 2009 at 11:35 AM

Hi All, I have been getting the error message v.i.z., "403 Forbidden".

My question to Maartenba: Can you send me the format of the header?

Also, my understanding from the discussion going on is that, in the code given by "kishorec4" the account name should not be literally taken as XXXXXXX (that might explain why maartenba got the same error message).

Coordinator
Sep 8, 2009 at 12:18 PM

Just noticed: this: define('TESTS_Table_HOST', 'table.core.windows.net/'); should be this: define('TESTS_Table_HOST', 'table.core.windows.net'); (no trailing slash)

Sep 8, 2009 at 1:10 PM

Hi Maarteenba,

Thanks for your reply, still we are not able to talk to Azure but we are able to talk to Azure by using RESTparser classes.

 

Coordinator
Sep 8, 2009 at 7:08 PM

That is strange. Can you send me your account name + key via the contact page? I'll see why the signature is invalid.

(click my user name, then contact)

Sep 18, 2009 at 4:19 PM

Hi Maartenba,

I have tried to insert some entity into the tablestorage using the PHP Azure SDK but I think I am going wrong somewhere. Can you send me the code for the same with some live account name and storage account key?

Coordinator
Sep 21, 2009 at 6:40 AM

Have a look at the testconfiguration.php file in the download, it contains our test account key.