java - 无法从 AppEngine java 访问 BigQuery

标签 java google-app-engine google-api google-bigquery

我有一个与 BigQuery 项目关联的 AppEngine 帐户,但是当我尝试运行查询时,我在响应中收到“拒绝访问”。我已经像这样设置了一个 AppIdentityCredential:

 private static AppIdentityCredential getCredential() throws IOException, GeneralSecurityException {
    return new AppIdentityCredential(BigqueryScopes.BIGQUERY);
  }

  public static Bigquery createAuthorizedClient() throws IOException, GeneralSecurityException {
    return new Bigquery(TRANSPORT, JSON_FACTORY, getCredential());
  }

我还尝试按照此处的指示使我的 AppEngine 帐户成为 BigQuery“团队”的成员:https://developers.google.com/bigquery/docs/authorization#service-accounts-appengine

但是,Google 的 API 控制台上的团队页面在我的 AppEngine 服务帐户名称旁边显示“已发送邀请。等待响应”。我没有收到邀请(超过 18 小时),尽管我是 AppEngine 和 BigQuery 双方的所有者和唯一的团队成员。这让我认为 BigQuery/AppEngine 服务集成刚刚被打破,但如果有人看到我做错了什么,我将非常感谢帮助。

最佳答案

我的猜测是您在控制台项目中的团队选项卡链接到应用引擎权限,也就是说,当您希望提供访问权限的邮件地址显示待处理时。

请尝试在启用 Bigquery API(可选 GS API)的情况下创建新的控制台项目。之后添加您的 appengine 服务帐户 (xxxxxx@appspot.gserviceaccount.com),并具有编辑权限。

希望有了它你一定能做你想做的事。

另请参阅 Michael Manoochehri 的帖子对于片段。

关于java - 无法从 AppEngine java 访问 BigQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15669749/

相关文章:

java - xmlbeans - 设置复杂类型的内容

java - 列出 Clojure 协议(protocol)扩展到的类/接口(interface)

java - Sonarqube 的 UndocumentedApi 变得毫无用处?

python - 在 GAE 中实现 URL slug

google-api - 具有捆绑标识符的 iOS 应用程序的 API key 限制

java - ArrayList 多次具有相同的条目

google-app-engine - 在 GAE 中使用 Parse REST API 时出现 SocketTimeoutException

multithreading - 2.7转换后Mapreduce不再起作用

node.js - Nodejs 创建后,API Rest 谷歌驱动器文件夹不可见

php - 获取谷歌日历, “Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.”