microsoft / AIforEarthDataSets

Notebooks and documentation for AI-for-Earth-managed datasets on Azure

Home Page:https://microsoft.github.io/AIforEarthDataSets/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentinel 3 Token ClientAuthenticationError

sopac opened this issue · comments

Hi, I am trying to run the Sentinel 3 notebook and am retrieving the SAS token on the fly from https://planetarycomputer.microsoft.com/api/sas/v1/token/sentinel3euwest/sentinel-3 and saving them as a text file.

I am able to retrieve the scenes from SciHub, however while the listing the blobs using Azure container client; I get the error below:

ClientAuthenticationError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:1a44bfb3-001e-0015-5ad0-6033fc000000
Time:2022-05-05T22:32:55.2029339Z
ErrorCode:AuthenticationFailed
authenticationerrordetail:The MAC signature found in the HTTP request '70KLIGh33cHeZoJWYUZGhUJeaobyK/t522J6P4WX8FA=' is not the same as any computed signature. Server used following string to sign: GET

Is there another correct way to incorporate the SAS token?

Token error is solved by converting token JSON to dict and extracting token parameter.

dict_token = json.loads(sas_token)
sas_token = "?" + dict_token.get("token")