strapi-provider-upload-azure-storage icon indicating copy to clipboard operation
strapi-provider-upload-azure-storage copied to clipboard

403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)

Open walterspieler opened this issue 1 year ago • 6 comments

Hello, I hope you're all fine.

I have a bug when I try to download a media from the media library. My Azure config seems fine since I can upload media to my azure storage.

Screenshot 2023-06-29 at 11 59 27 Screenshot 2023-06-29 at 11 37 39

I can provide a screenshot of the query Screenshot 2023-06-29 at 12 01 39

Thank you for your answers :)

walterspieler avatar Jun 29 '23 10:06 walterspieler

Hello @walterspieler, thanks for reporting. I would need to do some testing to see how strapi is trying to download. Will you confirm that your access key has sufficient perms to allow downloads?

jakeFeldman avatar Jun 30 '23 03:06 jakeFeldman

Hello @jakeFeldman, Sorry i only see this message now. Yes I am Admin on Strapi side and I have all rights in storage. I use the Access key. I even tried with a signature (Shared Access Signature) w/ everything checked

Screenshot 2023-07-05 at 17 31 25

walterspieler avatar Jul 05 '23 15:07 walterspieler

Sorry for the delay. I've been very busy at work ad have not had the time to work on this package. I'm looking for someone to help maintain the package.

jakeFeldman avatar Sep 07 '23 04:09 jakeFeldman

The problem is that Strapi send the strapi bearer token to the storage url since the latest update.

ArjanBlokJump avatar Sep 12 '23 08:09 ArjanBlokJump

In your associated .env file, you need to add the following: STORAGE_ACCOUNT_SAS_TOKEN=

The problem in the code is this line:

if (sasToken != '') {

It's specifically looking for a blank value. In my case, I didn't put that value into the .env and I'm assuming that it's determined to be a null value. Thus, the code within the if statement is always run.

I did try putting in a value for "STORAGE_ACCOUNT_SAS_TOKEN" as well, but that didn't work either. Anyhow, it works now with the accountKey.

conradagramont avatar Sep 24 '23 17:09 conradagramont

I'm having the same issue. When clicking download, wouldn't it be easier to just open the download link in a new tab?

jaredbouwer avatar Oct 12 '23 13:10 jaredbouwer