dataform icon indicating copy to clipboard operation
dataform copied to clipboard

Support BigQuery oauth credentials

Open lewish opened this issue 5 years ago • 5 comments

Currently BigQuery can only be authorized through a service account, which adds significant overhead to setting up a BQ project.

It should be possible to provide oauth credentials when executing against BigQuery.

  • During init-creds add an option to use OAuth for BigQuery projects

  • Send the user to the oauth connection page with a callback to localhost:someport

  • Spin up a small server to handle the oauth callback

  • Write the oauth credentials to the .df-credentials.json file

  • [ ] Create a Dataform OAuth client ID

  • [ ] Support OAuth credentials in the BigQuery adapter and extend the credentials proto to store this

  • [ ] Implement the new init-creds flow above

lewish avatar May 29 '19 20:05 lewish

👍 we would definitely like to have this

dorzey avatar Oct 18 '19 10:10 dorzey

Downloading service account keys is not very good security practice. The better approach is to use OAUTH as described in this article: https://medium.com/@jryancanty/stop-downloading-google-cloud-service-account-keys-1811d44a97d9

One way to do this is to use GOOGLE_APPLICATION_CREDENTIALS as described in: https://github.com/dataform-co/dataform/issues/1164

Another way is for Dataform to expect a short-lived OAuth 2.0 access token, either as input to the CLI or from an environment variable like as done by terraform: https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#access_token

thinhha avatar Feb 04 '21 15:02 thinhha

I wholeheartedly agree with @thinhha , access tokens would be an ideal mechanism here.

jamiekt avatar Feb 22 '21 12:02 jamiekt

This is a very relevant reference: https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials

jamiekt avatar Feb 25 '21 07:02 jamiekt

more details on how DBT did this here: https://github.com/fishtown-analytics/dbt/issues/2672

thinhha avatar Mar 07 '21 17:03 thinhha