使用 JSON 进行 GBQ 身份验证
我正在检索 GBQ service_account 的凭据以进行身份验证和使用 GBQ。凭证带有 private_key、client_id、token_uri、project_id 和一些其他信息。我正在尝试创建一个像这样的客户端
const gbqCredentials = decodeKey(credentials),
bigQuery = new BigQuery(JSON.parse(gbqCredentials.toString()));
但是我得到了下一个异常: {"message":"错误:无法加载默认凭据。浏览到 https:/ /cloud.google.com/docs/authentication/getting-started 了解更多信息.."}
I am retrieving the credentials for a GBQ service_account to authenticate and use GBQ. The credentials come with a private_key, client_id, token_uri, project_id and some other information. I am trying to create a client like this
const gbqCredentials = decodeKey(credentials),
bigQuery = new BigQuery(JSON.parse(gbqCredentials.toString()));
But i get th next exception:
{"message":"Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.."}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决这个问题,我通过 JSON 传递了凭据并添加了参数 projectId(我之前没有添加)。
To solve the issue I passed the credentials on a JSON and added a parameter projectId (Which I didn't add before).