title: How to initialize GoogleCredentials object without using credentials files created by gcloud auth login
body: <p>To connect to GCE i can use the credentials files created by <em>gcloud auth login</em>. Like this:</p>
  
  <pre><code>from oauth2client.client import GoogleCredentials
  from googleapiclient.discovery import build
  
  credentials = GoogleCredentials.get_application_default()
  compute = build('compute', 'v1', credentials=credentials)
  
  def list_instances(compute, project, zone):
      result = compute.instances().list(project=project, zone=zone).execute()
      return result['items']
  
  instances = list_instances(compute, 'project', 'zone')
  </code></pre>
  
  <p>Above code uses the credentials stored at ~/.config/gcloud </p>
  
  <p>I would like to initialize GoogleCredentials object by directly setting values inside the code. Like client_id, client_secret..</p>
  
  <p>PS: Above code is from this link : <a href="https://cloud.google.com/compute/docs/tutorials/python-guide#gettingstarted" rel="nofollow">https://cloud.google.com/compute/docs/tutorials/python-guide#gettingstarted</a></p>