Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Password protect site hosted on Google Cloud Storage

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?

like image 892
poiuytrez Avatar asked Jun 15 '15 12:06

poiuytrez


2 Answers

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.

like image 159
CoryatJohn Avatar answered Oct 12 '22 12:10

CoryatJohn


This is possible, but it requires combining a number of Google Cloud services. A load balancer delegates to a Cloud Run function that handles authentication and authorization and sets a cookie that is checked by Cloud CDN to grant access to the static assets hosted on Cloud Storage. Wiring this all together is described in the tutorial Protecting static website assets hosted on Cloud Storage.

like image 3
Geoffrey Hing Avatar answered Oct 12 '22 14:10

Geoffrey Hing