DEV Community


Posted on • Updated on


How to access Google Cloud Storage Bucket with Service account JSON

This method for gsutil to access Google Cloud Storage bucket with shared Service account with private key as JSON

Sample JSON Structure

  "type": "service_account",
  "project_id": "xxx",
  "private_key_id": "xxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\name-----END PRIVATE KEY-----\n",
  "client_email": "",
  "client_id": "xxx",
  "auth_uri": "",
  "token_uri": "",
  "auth_provider_x509_cert_url": "",
  "client_x509_cert_url": ""
Enter fullscreen mode Exit fullscreen mode
  1. Using gsutil config -e to set method to authentication
  2. Choose oAuth2 and provided full path of service account JSON file
  3. Then you can access with gsutil ls gs://{bucket-name}

Top comments (0)