locked
Authentication using azure storage Blob rest API giving error RRS feed

  • Question

  • I am trying to access blob container using rest API But its giving this error

    ==============================================================

    <?xml version="1.0" encoding="utf-8"?>
    <Error>
        <Code>AuthenticationFailed</Code>
        <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
    RequestId:573693f6-0001-002d-6b37-2c8eb8000000
    Time:2014-11-03T10:11:41.7093382Z</Message>
        <AuthenticationErrorDetail>The MAC signature found in the HTTP request 'cZVLNdLZqhN33hO0J94SF2aR1BCZM13zRdYJTn5sivU=' is not the same as any computed signature. Server used following string to sign: 'GET



    x-ms-date:Mon, 03 Nov 2014 09:58:28 GMT
    /acteonstorage/blobcontainer?comp=metadata'.</AuthenticationErrorDetail>
    </Error>

    =========================================================================

    I have checked my header string before encoding its also coming the same as it mention the string  in the error

    GET



    x-ms-date:Mon, 03 Nov 2014 09:57:00 GMT
    /acteonstorage/blobcontainer?comp=metadata

    so where is the error.Is this in encoding code, i am using this c# code for encoding the header signature                 

    System.Security.Cryptography.HMACSHA256

    hasher = new System.Security.Cryptography.HMACSHA256(Convert.FromBase64String(Secretkey));

                    // Authorization header
                    string authH = "SharedKey " + _Account + ":" + System.Convert.ToBase64String(hasher.ComputeHash(System.Text.Encoding.UTF8.GetBytes(signature)));

                  // Add the Authorization header to the request
                    request.Headers.Add("Authorization", authH);  

    So Please hep me to resolve this issue.   Regards, Ashok

    Monday, November 3, 2014 11:51 AM

Answers

All replies