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

Ashish Gupta 6 Reputation points
2020-03-27T20:09:32.17+00:00

Hi Team,

I am getting the below error when trying to access Azure File Storage via REST API.

<?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:ec7674c7-601a-0042-076e-04b74e000000
Time:2020-03-27T19:34:24.8637725Z</Message>
<AuthenticationErrorDetail>The MAC signature found in the HTTP request 'ODdiYjQzMmY1MWEzOGUyZDJmYjgxNDVkZDZkMmMxYWUxODQyM2FmNTE0YWRhYmJjMTBlZGJkYWU0MWI0MTJlYw==' is not the same as any computed signature. Server used following string to sign: 'GET

x-ms-date:Fri, 27 Mar 2020 19:29:12 GMT
x-ms-version:2015-02-21
/pocfilecloud/demofs101/testfilecloud.txt'.</AuthenticationErrorDetail>
</Error>

Below are the steps that I am performing :-

SignatureString:- GET\n\ntext/plain; charset=UTF-8\n\nx-ms-date:Fri, 27 Mar 2020 18:15:12 GMT\n/demofs101/testfilecloud.txt

Did UTF-8 encoding on it with output as "\x47\x45\x54\x5c\x6e\x5c\x6e\x74\x65\x78\x74\x2f\x70\x6c\x61\x69\x6e\x3b\x20\x63\x68\x61\x72\x73\x65\x74\x3d\x55\x54\x46\x2d\x38\x5c\x6e\x5c\x6e\x78\x2d\x6d\x73\x2d\x64\x61\x74\x65\x3a\x46\x72\x69\x2c\x20\x32\x37\x20\x4d\x61\x72\x20\x32\x30\x32\x30\x20\x31\x38\x3a\x31\x35\x3a\x31\x32\x20\x47\x4d\x54\x5c\x6e\x2f\x64\x65\x6d\x6f\x66\x73\x31\x30\x31\x2f\x74\x65\x73\x74\x66\x69\x6c\x65\x63\x6c\x6f\x75\x64\x2e\x74\x78\x74"

Decoded Base64 access key, got the output as " B):f7 qb#m : , #Q'4&̾ #lP[' eTWYR"

Then did a HMAC with SHA256 on both the above and finally a Base64 encoding on the output.

Kindly assist.

Thanks and Regards
Ashish Gupta

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
23,914 questions
1 vote