0

I have access to an Azure batch service with the account name and base64 authentication key. A coworker wrote a batch service that retrieves files, processes them, and returns them to a specified location. These files are stored in a SharePoint library, and the batch service works fine. What we would like to do, is from the browser, setup an ajax call in jQuery/ajax to properly create the correct headers and the proper authentication information to perform this request. I have found some documentation but no real examples that work because I primarily end up with an error:

The MAC signature found in the HTTP request is not the same as any computed signature.

It displays what it uses to create a key so I thought I would do that same thing but it still doesn't work and I get the same error.

spevilgenius
  • 101
  • 3

1 Answers1

1

Glad that Batch service part is working great.

WIth regards to the error message: "The MAC signature found in the HTTP request is not the same as any computed signature." Every request made against a storage service must be authenticated, In this case its related with the Authentication for Azure Storage.

Also, please take a look at the similar issue happened in past here:

Authentication for Azure Storage is not simply a matter of providing the access key (that is not very secure). You need to create a signature string that represents the given request, sign the string with the HMAC-SHA256 algorithm (using your storage key to sign), and encode the result in base 64. See https://msdn.microsoft.com/en-us/library/azure/dd179428.aspx for full details, including how to construct the signature string.

Tats_innit
  • 33,991
  • 10
  • 71
  • 77
  • Thanks for this response! I had found most of these but none of them seem to help me get an answer for doing this in web browser javascript/jQuery. I am sure that much of that is because of the need to perform various conversions between base64 and UTF8 but no real examples on using web based javascript to do it. I may end having to use c# from a service and just send an ajax call to that but not sure. – spevilgenius Dec 11 '17 at 11:25
  • Cool, no probs at all! `:)` If you have any code to share then feel free. Thanks – Tats_innit Dec 11 '17 at 23:08