0

I am trying to set up a file distribution to a couple of registered users. I am experimenting with GCS. The files must not be publicly available without logging in even temporarily.

I have created a bucket, given permissions to a specific google account, and done the same with the actual file in the bucket. When I try to access

https://storage.googleapis.com/my-bucket/testfile.txt

I am promptly presented with a login page, and when I login with the proper credentials, I am redirected to 403 Forbidden page.

If I do not access the file directly but navigate to

https://storage.googleapis.com/my-bucket

instead, I can see the file there in the bucket and when I click it, also download it by clicking it, which means permissions are correct (I have granted legacy bucket reader and legacy object reader). But I seem also able to modify the bucket settings like storage (near/local/whatever), which in this case would be less than optimal.

How do I solve this? How can I make it so that by knowing the exact URL, a user can access it, log in with their credentials and then receive the file, without having access to the actual bucket and its settings? How can I make the direct link to work, just to include Google authentication in between?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.