19
votes

We have a static website hosted on Google Cloud Storage. We would like it to be password protected. Is there a way to do it with Http basic auth?

2

2 Answers

8
votes

No. There appears to be no provision for using HTTP basic auth.

From what I can see, there is no provision for using a password protected website on GCS. The .htaccess file is not recognized and there are no commands in gsutil that can be used to control such access.

There are other methods of making the data private and granting methods of access available for GCS but they aren't the same as the basic HTTP auth.

This page of the documentation goes over the types of credentials allowed.

0
votes

You should be able to do this through the IAM in the storage security. - Clicking on the security menu to the right of the storage, you can select who has access to a role to view. This would not be username and password, but through GCP IAM.