Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery 3.0.0 - OAuth2 Authentication #418

Closed
1 task
rac0316 opened this issue Apr 19, 2019 · 8 comments
Closed
1 task

BigQuery 3.0.0 - OAuth2 Authentication #418

rac0316 opened this issue Apr 19, 2019 · 8 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@rac0316
Copy link

rac0316 commented Apr 19, 2019

Blocked

Environment details

  • OS: Windows 10
  • Node.js version: 10.15.1
  • npm version: 6.4.1
  • @google-cloud/bigquery version: 3.0.0

Steps to reproduce

  1. Attempting to use an OAuth2 token to authenticate to the BigQuery API version 3.0.0. Successfully can get a valid token using tutorial here: https://github.com/googleapis/google-auth-library-nodejs#oauth2

  2. Instantiate BigQuery with token and project param new BigQuery({ token: validAuthTokenFromAbove, projectId: validProjectId });

  3. Attempt to run a query - this will return a "failed to fetch" error. After digging into the code, it's trying to fall back to Application Default Credentials. It seems the token property is being ignored.

*** If I downgrade BigQuery to v 1.3.0 everything works fine! I'll be using this for now until this gets resolved.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 20, 2019
@callmehiphop callmehiphop added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Apr 22, 2019
@stephenplusplus
Copy link
Contributor

@callmehiphop @rac0316 do we support receiving a token option in a constructor?

@rac0316
Copy link
Author

rac0316 commented Apr 24, 2019

In version 1.3 it was supported as an optional field. See: https://cloud.google.com/nodejs/docs/reference/bigquery/1.3.x/global#ClientConfig

It seemed to have gotten lost somewhere in the latest releases. I did a little research and it looks like when the @google-cloud/common API was upgraded past version 0.17, the token option broke.

BigQuery 1.3 uses @google-cloud/common 0.17, which uses this library for authentication in the background: https://github.com/stephenplusplus/google-auto-auth

BigQuery 3.0 uses @google-cloud/common 0.32, which uses the official google-auth-library: https://github.com/googleapis/google-auth-library-nodejs

**I can verify if you downgrade the @google-cloud/common back to 0.17 w/ BigQuery 3.0, the token option works as expected.

@stephenplusplus
Copy link
Contributor

Good catch! I opened an issue over on the auth library: googleapis/google-auth-library-nodejs#677.

@stephenplusplus stephenplusplus added the status: blocked Resolving the issue is dependent on other work. label Apr 25, 2019
@grant
Copy link

grant commented Jun 11, 2019

This issue is preventing a sample from being created for this doc:
https://cloud.google.com/bigquery/docs/authentication/end-user-installed

@MartinSahlen
Copy link

Hello, I managed to get over this bug by doing this: #68 (comment)

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Oct 16, 2019
@meredithslota
Copy link
Contributor

Tagging in @feywind as an FYI.

@tswast tswast assigned steffnay and unassigned tswast Jan 8, 2020
@tswast
Copy link
Contributor

tswast commented Jan 8, 2020

Possibly fixed by #566

@steffnay
Copy link
Contributor

steffnay commented Jan 27, 2020

@google-cloud-label-sync google-cloud-label-sync bot added the api: bigquery Issues related to the googleapis/nodejs-bigquery API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/nodejs-bigquery API. priority: p2 Moderately-important priority. Fix may not be included in next release. 🚨 This issue needs some love. status: blocked Resolving the issue is dependent on other work. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

9 participants