I'd like to access Google Cloud Storage from my scripts, and I need to automate authentication. By default, gsutil config asks to open a link and type in generated code, and then it writes OAuth token into .boto file.
Google Cloud also supports creating OAuth 2.0 client IDs in "Credentials" page, but I cannot make sense how to plug those credentials (client_id and client_secret) into my .boto file:
{"installed":{"client_id":"677005197220-eim3l5of3m16225qr0m9vquocj6mugt4.apps.googleusercontent.com","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"pFghf5URxxxBFVRsQ1elWbbZ","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}
(Please don't try to use it, as I slightly modified the codes)
I plugged them in .boto file in this way:
[OAuth2]
client_id ="677005197220-eim3l5of3m16225qr0m9vquocj6mugt4.apps.googleusercontent.com" client_secret ="pFghf5URxxxBFVRsQ1elWbbZ" provider_label = Google provider_authorization_uri = https://accounts.google.com/o/oauth2/auth provider_token_uri = https://accounts.google.com/o/oauth2/token
This is how gsutil is failing:
# gsutil ls gs://mybucket/ You are attempting to access protected data with no configured credentials. Please visit https://cloud.google.com/console#/project and sign up for an account, and then run the "gsutil config" command to configure gsutil to use these credentials.
If I run gsutil config I can configure credentials and then it works, but I need to use my client ID and client secret. Can someone please suggest how to make gsutil work with .boto with client_id and client_secret? Thanks