question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

User credentials for BigQuery

See original GitHub issue

Now that https://github.com/ibis-project/ibis/issues/1528 is implemented, itā€™s possible to send any kind of credentials to use with BigQuery. šŸŽ‰ But, itā€™s still a bit difficult to use user credentials for BigQuery.

The ā€œapplication default credentialsā€ used by the BigQuery client library use:

  1. The metadata server to get credentials on App Engine, Compute Engine, ā€¦
  2. A service account key file, whose path is described by the GOOGLE_APPLICATION_CREDENTIALS environment variable (what Google Cloud recommends in their authentication getting started guide).
  3. User credentials from the Cloud SDK gcloud command-line tool, but these credentials now raise a warning in the Google Auth layer (mostly because they donā€™t work for some APIs such as the Vision and Speech APIs).

I propose Ibis add a fourth fall-back option (or even skip 3 altogether) to do end-user authentication itself.

The reason for this is that is makes the getting started experience a lot easier. All theyā€™ll need is Python and the library installed and they can use Ibis with BigQuery with their own credentials. No gcloud installation or service account needed.

Iā€™ve created a API credentials called ā€œIbis Libraryā€ in the Ibis GBQ project that we can use for this.

The code at Pandas GBQ https://github.com/pydata/pandas-gbq/blob/993fe55f7e1f44a15b282b415284774310fc530c/pandas_gbq/auth.py#L113-L175 will be useful as a model to follow.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cpcloudcommented, Mar 13, 2019

Going to get this in for 1.0.0, which we are shooting to release next week.

0reactions
tswastcommented, Jan 2, 2019

Iā€™m converting pandas-gbq to use pydata-google-auth in https://github.com/pydata/pandas-gbq/pull/241.

For Ibis to use it, weā€™ll want to call pydata_google_auth.default() just before we create the BigQuery client if the credentials argument is None.

We should use the client ID and client secret from the ibis-gbq GCP project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to authentication | BigQuery - Google Cloud
Use user credentials to ensure that your application has access only to BigQuery tables that are available to the end user. A user...
Read more >
A Complete Guide for Google BigQuery Authentication Tutorial
Service Account based Authentication ... Login to your Google Cloud Console. Open the Burger Menu on the side and Go to IAM ->...
Read more >
Running a BigQuery SQL query in Python, how to authenticate?
In order to authenticate to any GCP API it's recommended to use a service account credential, the docs will teach you how to...
Read more >
Google BigQuery Authentication | Cyclr Documentation
Setup Google OAuth2 Credentialsā€‹ā€‹ First setup OAuth2 within Google Developer Console. Sign up for a Google account; or log into an existing account....
Read more >
BigQuery ā€” Faculty platform documentation
Installing BigQuery clientsĀ¶ ... There are two main ways to get authorized to GCP: through a personal account, or through service account (a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found