Hi,
I'm attempting to access an item stored in Azure Blob storage via access token. The access token is sent in the Authorization header as a Bearer token. Public access and access keys have been disabled globally on the storage account, leaving Entra ID as the only means of authenticating requests against the storage account. I am able to access the document in question via the Azure Portal using my Entra ID account, so I have confirmed I have the relevant permissions necessary to perform the request.
The Vue application that I'm build uses the @azure/msal-browser
package to request an access token from Entra ID before attempting to retrieve the document from Azure storage. Given the nature of the application, I prefer to avoid using SAS tokens. When requesting the access token for the request, I have tried every scope I can think of, and tinkered with the authority setting with little success. Every time I think I'm getting closer, I get one of the two following error messages:
<?xml version="1.0" encoding="utf-8"?>
<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:1345cc3b-d01e-0039-275c-de966a000000
Time:2024-07-25T06:30:08.3540439Z</Message>
<AuthenticationErrorDetail>Signature validation failed. Signature verification failed.</AuthenticationErrorDetail>
</Error>
<?xml version="1.0" encoding="utf-8"?>
<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:5eeb5049-f01e-0011-125f-def7c2000000
Time:2024-07-25T06:55:14.2451440Z</Message>
<AuthenticationErrorDetail>Issuer validation failed. Issuer did not match.</AuthenticationErrorDetail>
</Error>
I have also set the x-ms-version
header to 2017-11-09
as outlined in some documentation to no avail. I have also set the www-authenticate
header to Bearer authorization_uri=${authority} resource_id=https://{storage_account}.blob.core.windows.net
(and tried the more generic resource_id=https://storage.azure.com
). Authority in this instance refers to the authority set in the @azure/msal-browser
configuration, but I also tried the Entra External ID's authorize endpoint too.
CORS is enabled on the storage account, but for testing purposes I have set it as permissive as possible. At any rate, the process fails whether I'm using a browser or Postman to initiate the request.
I'm at a loss on what to do - my understanding is that I should be able to access the resource if I present a valid access token generated by Entra ID for that tenant. Is it simply a case that Entra External ID cannot access Azure Storage using access tokens generated by @azure/msal-browser
, or have I set a parameter wrong somewhere?