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

Sep 4, 2009 at 10:11 AM
Edited Sep 4, 2009 at 10: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:

Sep 4, 2009 at 12:14 PM

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

Sep 4, 2009 at 1:12 PM

Please check the below code


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

require_once 'Microsoft/Azure/RetryPolicy.php';
define('TESTS_Table_HOST', '');

define('TESTS_STORAGE_KEY',     "zszLxdXM/ZA2ELYCkuCBiuYbmDeVszTOOKhS1R9Q/zuQ8QIBbIVecpwPET9LI1cTuUPZzMinWUo/FTve8oS3fw==");
 $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();
  echo "<b>&nbsp; Container list is empty </b>" . "<br/><br/>";
  echo var_dump($containerresult) . "<br/><br/>";
catch(Exception $ex)
echo "<font color=red><b>&nbsp;!! ERROR : </font></b>" . $ex->getMessage(). "<br/><br/>";

Sep 4, 2009 at 1:30 PM

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

Sep 7, 2009 at 4: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.

Sep 7, 2009 at 7: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 8:30 AM

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

Sep 7, 2009 at 11:54 AM

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

Sep 7, 2009 at 3: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 12:35 PM

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).

Sep 8, 2009 at 1:18 PM

Just noticed: this: define('TESTS_Table_HOST', ''); should be this: define('TESTS_Table_HOST', ''); (no trailing slash)

Sep 8, 2009 at 2: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.


Sep 8, 2009 at 8: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 5: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?

Sep 21, 2009 at 7:40 AM

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