“域策略已禁用第三方云端硬盘应用”

时间:2013-01-24 10:40:33

标签: google-drive-api

对于某些域,我们的应用程序不起作用。我已检查其Google Apps域配置并启用了Google云端硬盘。 有什么想法吗?

com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 OK
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "location" : "Authorization",
    "locationType" : "header",
    "message" : "The domain policy has disabled third-party Drive apps",
    "reason" : "domainPolicy"
  } ],
  "message" : "The domain policy has disabled third-party Drive apps"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:143)
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.execute(GoogleJsonResponseException.java:187)
    at com.google.api.client.googleapis.services.GoogleClient.executeUnparsed(GoogleClient.java:279)
    at com.google.api.client.http.json.JsonHttpRequest.executeUnparsed(JsonHttpRequest.java:207)
    at com.google.api.services.drive.Drive$Files$Insert.executeUnparsed(Drive.java:307)
    at com.google.api.services.drive.Drive$Files$Insert.execute(Drive.java:331)

1 个答案:

答案 0 :(得分:11)

即使为用户启用了Google云端硬盘服务,管理员也可以通过访问应用>限制用户安装Google云端硬盘应用或使用Google云端硬盘API。 Google Apps>然后,在“数据访问”菜单中取消选中“允许用户安装Google云端硬盘应用”设置。

您看到的错误消息表明这些域名未选中“允许用户安装Google云端硬盘应用”。您的应用程序应该通过以下方式向用户发送消息来处理此错误:

Sorry, you cannot use this application because your administrator has disabled 3rd party Google Drive apps. Please ask your administrator to allow Google Drive apps by opening the Google Apps control panel and going to Apps > Google Apps > Settings for Drive and making sure "Allow users to install Google Drive apps" in the "Data Access" menu is enabled.

相关问题