Generate SAS tokens with get_service_sas or get_account_sas
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the documented get_service_sas and get_account_sas entry points and reproduce the example using the supplied storage endpoint, key, container, and blob values. Compare the generated URL and its string-to-sign with the Azure authentication error; done means the SAS-appended blob URL authenticates successfully.
Written by the indexing model from the issue text.
Description
I'm trying to generate SAS tokens using the two functions mentioned above. Using example code in the docs (below) a SAS token is generated, however when I append this to the end of the blob I want to access I get an error stating the signature did not match.
I generate the SAS as follows:
endp <- storage_endpoint(Sys.getenv("LONDON_BUS_STORAGE_ENDPOINT"), key=Sys.getenv("LONDON_BUS_STORAGE_KEY"))
sas <- get_service_sas(endp, resource = Sys.getenv("LONDON_BUS_ANNOTATE_CONTAINER_NAME"), permissions="r")
blob_file_url_with_sas <- paste0(Sys.getenv("LONDON_BUS_STORAGE_ENDPOINT"), "/", Sys.getenv("LONDON_BUS_ANNOTATE_CONTAINER_NAME"), "/", Sys.getenv("LONDON_BUS_ANNOTATE_FILE"), sas)
Where the environmental variables relate to the storage account, storage account key, container name, and the name of the blob.
The error is:
<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:2b7236bd-301e-004c-2d6b-757ef4000000 Time:2024-03-13T17:22:19.7678924Z</Message>
<AuthenticationErrorDetail>Signature did not match. String to sign used was r 2024-03-13T17:07:02Z 2024-03-14T01:07:02Z /blob/{{MY_STORAGE_ACCOUNT}}/{{MY_CONTAINER}} 2021-06-08 c </AuthenticationErrorDetail>
</Error>
When I generate a SAS token in the GUI in my Azure account everything works. I'm only trying to generate with AzureStor so that I can generate frequently for extra security.
Any help on this is much appreciated. I've tried numerous variations of the SAS.
- Dominant language
- R
- Stars
- 68
- Forks
- 27
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/AzureStor
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
documentation pkg infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiverse-trace/epiparameter#511 ·
-
function:write_dwc
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100