Issue #221 new

Google Cloud storage “Security credentials are not valid” Using boto.gs.connection

Vishnu Upadhyay
created an issue

I have tried it a lot to connect to Google Cloud Storage (GCS) using boto.gs.connection

boto.gs.connection
from boto.gs.connection import GSConnection
headers = {'x-goog-project-id': 'Given on Google Console'}
conn=GSConnection(gs_access_key_id=CLIENT_ID, 
                            gs_secret_access_key=CLIENT_SECRET)
bucket = conn.get_bucket(BUCKET_NAME)

GSResponseError: GSResponseError: 403 Forbidden The provided security credentials are not valid. changes the security permission even done INTEROPERABILTY for GCS but still get same error.

Where client_id,private_key_id are the credentials provided by GCS from file "project_name-id.json"

while connecting boto.storage_uri works with same credential.

#! python
import boto
import gcs_oauth2_boto_plugin
CLIENT_ID = client_id
CLIENT_SECRET = private_key_id
gcs_oauth2_boto_plugin.SetFallbackClientIdAndSecret(CLIENT_ID, CLIENT_SECRET)
GOOGLE_STORAGE = 'gs'
output = BUCKET_NAME+'/filename'
f = file('/home/user/upload.txt')
dst_uri = boto.storage_uri(output, GOOGLE_STORAGE)
dst_uri.new_key().set_contents_from_file(f)

Already ask on Stackoverflow:- http://stackoverflow.com/questions/31703399/google-cloud-storage-security-credentials-are-not-valid-using-boto-gs-connecti

Comments (2)

  1. Log in to comment