Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate SAS tokens with get_service_sas or get_account_sas #140

Open
dempseynoel opened this issue Mar 13, 2024 · 0 comments
Open

Generate SAS tokens with get_service_sas or get_account_sas #140

dempseynoel opened this issue Mar 13, 2024 · 0 comments

Comments

@dempseynoel
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant