apache / arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
https://arrow.apache.org/
Apache License 2.0
14.64k stars 3.56k forks source link

[R] Test GCS auth with gargle/googleAuthR #20297

Open asfimport opened 2 years ago

asfimport commented 2 years ago

These are the main packages that let folks worth with Google Cloud from R, so we should make sure we can play nicely with their auth methods, how they cache credentials, etc.

Reporter: Neal Richardson / @nealrichardson

Note: This issue was originally created as ARROW-16880. Please see the migration documentation for further details.

asfimport commented 2 years ago

Will Jones / @wjones127: I looked into this a bit, and someone should correct me I'm off base, but I'm not sure integration will be useful except in very specific cases. gargle basically let's you have an OAuth flow in R, where it can request specific scopes. When I tried this with the default app ID, Google came back to me saying it blocked access. So I think in order to use it you need to create your own OAuth app in Google, and hook it up to gargle.

It seems the likely auth flows for our users are:

 1. For analysts in local environments: Use application default credentials (run {}gcloud auth application-default login{}) and everything will run fine.

  1. For deployed apps (e.g. Shiny): create a service account, download a credentials file onto the server, and provide the path to the downloaded credentials file to GcsFileSystem$create()

I'm still trying to grok GCP's authentication approach, so I welcome any input.