I have image files in Firebase Storage what have Download URLs. I can access these just fine through the Download URLs.
I have set up a Google Cloud Platform CDN to point at my Firebase Storage bucket. When I try to access images in the bucket, I get an Access denied. response.
The instructions for setting up a GCP CDN pointed to a Bucket say to use the format:
https://[IP_ADDRESS]/static/[REGION]/[OBJECT_NAME]
I used the external load balancer IP Address, "us" for the region, and I have tried several things for [object_name].
The image file Object has a Download URL that looks like this:
https://firebasestorage.googleapis.com/v0/b/xxxx.appspot.com/o/-LmBkDlSNaSqtFI8AfFX%2Ffoo%2Fbar_-LmDYUM32YieXcpjm7jR.png?alt=media&token=61E4F4A8-99BF-495E-89F0-03BB565D0D8A
So, I tried using everything after /o/
as [object_name]
I tried the storage location path.
I tried URL encoding the slashes in both of these.
In all cases, I get the following:
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>Anonymous caller does not have storage.objects.get access to buttons-dev.appspot.com/static/us/-LmBkDlSNaSqtFI8AfFH/circles/circle_-LmDYUM32YieTcpjm7jR.png.
</Details>
</Error>
The permissions in Firebase Storage for the bucket are set to:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}
But, the Download URL should work for direct viewing of a particular file.
Also, I tried setting allow: read;
for permissions, and nothing changed.
How can I access a Firebase Storage object in through it's Download URL and a Google Cloud Platform CDN?