Issue #221 new

Google Cloud storage “Security credentials are not valid” Using

Vishnu Upadhyay
created an issue

I have tried it a lot to connect to Google Cloud Storage (GCS) using
from import GSConnection
headers = {'x-goog-project-id': 'Given on Google Console'}
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)
output = BUCKET_NAME+'/filename'
f = file('/home/user/upload.txt')
dst_uri = boto.storage_uri(output, GOOGLE_STORAGE)

Already ask on Stackoverflow:-

Comments (2)

  1. Log in to comment