title: How to list buckets from Google Storage in Python?
body: <p>I have the following code in Python script:</p>
  
  <pre><code>from google.oauth2 import service_account
  SCOPES = ['https://www.googleapis.com/auth/sqlservice.admin']
  SERVICE_ACCOUNT_FILE = 'JSON_AUTH_FILE'
  credentials = service_account.Credentials.from_service_account_file(
              SERVICE_ACCOUNT_FILE, scopes=SCOPES)
  import os
  os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = SERVICE_ACCOUNT_FILE
  </code></pre>
  
  <p>This does the auth with google.</p>
  
  <p>Now I want to list all buckets :</p>
  
  <pre><code>from google.cloud import storage
  storage_client = storage.Client()
  buckets = list(storage_client.list_buckets())
  print(buckets)
  </code></pre>
  
  <p>But this doesn't work. I get:</p>
  
  <pre><code>google.api_core.exceptions.Forbidden: 403
  
  xxx@yyy.iam.gserviceaccount.com does not have storage.buckets.list access to project
  </code></pre>
  
  <p>It also has a link when I click it i see (which is weird because it says 403 but here it shows 401:</p>
  
  <pre><code>{
   "error": {
    "errors": [
     {
      "domain": "global",
      "reason": "required",
      "message": "Anonymous caller does not have storage.buckets.list access to project NUMBER.",
      "locationType": "header",
      "location": "Authorization"
     }
    ],
    "code": 401,
    "message": "Anonymous caller does not have storage.buckets.list access to project NUMBER."
   }
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>