4
votes

I would like to use only http calls (e.g., with curl) to make authenticated calls to the google cloud storage API.

Using the google dev console, I have enabled the API and downloaded three created sets of credential information. These information JSON files have the following fields:

  • ['token_uri', 'client_secret', 'client_id', 'auth_uri', 'project_id', 'auth_provider_x509_cert_url', 'redirect_uris'] within 'installed' field
  • ['token_uri', 'client_email', 'client_id', 'client_x509_cert_url', 'auth_uri', 'project_id', 'type', 'auth_provider_x509_cert_url', 'private_key', 'private_key_id']
  • ['project_id', 'token_uri', 'client_id', 'auth_provider_x509_cert_url', 'auth_uri'] within 'installed' field

What sequence of calls do I need to make? It can be assumed that the username/password are available for a user with access to the datastore .

(I believe this must be documented here on SO or elsewhere, but I am having no luck finding anything.)

1
For different scenarios the API calls will be different. visit this article for more information: developers.google.com/identity/protocols/OAuth2Kamran
OK, so which of these allows non-interactive access, and how to I obtain the various identifiers I need?mdurant
It sounds like you have already set up your credentials, and you're asking where to find documentation on how to make GCS API calls. If so, please see cloud.google.com/storage/docs/?csw=1Mike Schwartz

1 Answers

0
votes

In the end, I followed my intuition, and have wrapped the resulting code in my project GCSFS, specifically here which can take either the device code route (requires the user to interact with the browser), accepts a refresh token by any means, or accepts a google credential file of the sort produced by logging in with gcloud.