First of all, please confirm that the current setting is the required one and that it was correctly set up by checking that the credentials are correct: i.e., if you are using gsutil
, check that the credentials stored in your .boto
file are accurate. Also, confirm that gsutil is using the .boto
file you expect by using the command gsutil version -l
and checking the config path(s)
entry.
If the credentials are correct, then verify if your requests are being routed through a proxy, using HTTP (instead of HTTPS). If so, check whether your proxy is configured to remove the Authorization header from such requests. If so, make sure you are using HTTPS instead of HTTP for your requests.
Finally, go to the console and click on "Set bucket permissions" in the bucket's menu. Enter "allUsers" in Add Members, and assign Role -> Storage -> Storage Object Viewer.
Or, if you prefer to use gsutil
, running gsutil -m acl set -R -a public-read gs://bucket
should set access on all files in that bucket to the public. To set default permissions on the bucket in order to make those files public by default when they're added, use gsutil defacl set public-read gs://bucket
.
You can use the following GCP’s Official Documentation and the following thread as a reference.