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.

Make keyfilename authentication more consistent with other Node libraries

See original GitHub issue

This issue is related to our work in client extensible options.

Other Node libraries are able to authenticate using just a keyfileName in the constructor of the client. However, it is required to add a project_id variable in the constructor to authenticate, like so:

new BigQuery({
    keyFilename: //keyfile
    projectId: 
      process.env.GOOGLE_CLOUD_PROJECT  
  });

In order to be more consistent across libraries/requirements, it would be nice if we could get the project id from the keyfile itself, without having to declare it separately.

I think this work might be similar to this PR: https://github.com/googleapis/nodejs-pubsub/pull/731

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bcoecommented, Jun 19, 2020

@stephenplusplus @sofisl what’s weird, is I think you were noticing the project is appropriately detected in our auto generated libraries? which share the auth library.

@sofisl when we eventually dig into this, we might want to use npm link to test bigquery and the auth library at the same time.

0reactions
sofislcommented, Oct 21, 2020

Closing in lieu of #1084 in google-auth-library-nodejs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js google cloud storage authentication using credentials ...
js GCS api docs on how to do so. They instruct to generate and download a json file that contains your private key...
Read more >
Authenticating with a service account key file | BigQuery
Manually create and obtain service account credentials to use BigQuery when an application is deployed on premises or to other public clouds.
Read more >
Google APIs Node.js Client
Node.js client library for using Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT tokens is ...
Read more >
Handling dependencies | Cloud Functions for Firebase - Google
Private modules from other repositories. The npm documentation explains how to create custom read-only access tokens. We discourage using the .npmrc file ...
Read more >
How to migrate a Node.js app from ADAL to MSAL
How to update your existing Node.js application to use the Microsoft Authentication Library (MSAL) for authentication and authorization ...
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