You can use the following workaround to add user authentication to your GCS static pages based on buckets.
First you need to create a public file called redirect.html this file will be the entry point of your static webpage, and you need to add the following content
<html>
<head>
<meta http-equiv="Refresh" content="0; url=https://storage.cloud.google.com/[yourbucketname]/index.html">
</head>
Redirecting to your site..
index.html
and other files must be private files with read permissions granted to selected users
The magic behind this is that your browser will prompt to choose a google account, in case that your browser doesn't have any active google account.
And only the users with Reader permission (or with other roles with read access) will access to your static website.
Just a friendly reminder, this will take the main Google account in the browser if your browser have more than 1 Google account this can cause authentication issues, if this happens use an incognito window.
you can find more information on this Medium article
Extra step
If you have enabled Data access logs this workaround will thrown some authentication issues, you need to add exceptions to the users that will use the authenticated site
To do this, in Cloud Console, navigate to IAM & Admin > Audit Logs. Look through the list or filter for Google Cloud Storage
. Click on the row.
In the info panel on the right side, on the Exempted Users tab, click Add Exempted User.