1
votes

I wonder if it is possible to do: - I have a blob storage with some html webpage. That storage is private. I cannot be set as public access. Only user with tokens may access it.

It is possible to access single files using SAS token based authentication generating URI and a query string, but that only works for 1 file. I.E. I access a index.html page, but when I click a link on that page, access token is not passed, so I get 403 error for that subpage.

Is it possible to make it such, that token would allow all the subpages to access? I wonder if it is even achievable.

1

1 Answers

1
votes

Assuming:

  1. By access token you mean Shared Access Signature (SAS) token and
  2. All the files are in the same private container

It is certainly possible to access sub pages.

For that, first thing you would need to do is create the SAS token on the blob container and not on an individual file (index.html in your case).

Since the page is an HTML page and not generated dynamically, what you would need to do is when someone clicks on a link to a subpage, using JavaScript you would need to append that SAS token to the link.

For example, if there's a subpage called index2.html and when someone clicks on the link for that, using JavaScript you would read the query string from the URL for your main page (which is essentially the SAS token), append that SAS token to the link and then redirect the user to that link.