简体   繁体   中英

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

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.

在此处输入图像描述

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

在此处输入图像描述

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

在此处输入图像描述

Here is the Authorization section of postman

在此处输入图像描述

Thanks for the help.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM