Azure blob GET request authorization header "x-ms-date" field issue

Viewed 10456

I am trying to fetch a html page which is placed in Azure blob storage using postman. The default blob storage access has been set to private, so i have to send "Shared Key", "x-ms-version" and "x-ms-date" in the header section to Authorize.

Here is the screen shot of request in Postman.

enter image description here

When i click on send button i am getting an error stating "The date header in the request is incorrect".

enter image description here

Any ideas to solve the issue?

Update-Corrected Date Format

I corrected the "x-ms-date" format, now it throwing an error stating Authentication Info is not in correct format

enter image description here

Here is the Authorization section of postman

enter image description here

Thanks for the help.

4 Answers

Please review the documentation.

You need to specify two headers for correct request: Authorization and x-ms-date headers.

The correct format for x-ms-date header is Fri, 26 Jun 2015 23:39:12 GMT.

It seems your Authorization header is invalid. Try to regenerate your SAS key and test your request again.

As I understand correctly then you have only 15 minutes for requests.

From documentation:

The storage services ensure that a request is no older than 15 minutes by the time it reaches the service. This guards against certain security attacks, including replay attacks. When this check fails, the server returns response code 403 (Forbidden).

The format is Fri, 26 Jun 2015 23:39:12 GMT. In Python, this can be obtained via

import datetime
date = datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT')

assuming locale.en_US.

x-ms-date header must be specified in the following format: Fri, 26 Jun 2015 23:39:12 GMT.

Please try your request again with this format.

The format that you should have is: Thu Apr 7 16:55:44 CET 2022

Related