【问题标题】:Tasks API 403 Access Forbidden任务 API 403 禁止访问
【发布时间】:2014-03-30 19:27:06
【问题描述】:
03-30 15:20:53.422: W/System.err(25384):       "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."

我在尝试对 Taskslist 执行 GET 时收到此错误。

GoogleAccountCredential  credential = GoogleAccountCredential.usingOAuth2(context, TasksScopes.all());

SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
String accountName = settings.getString(GoogleIntegrationUtilities.GTASK_ACCOUNT_NAME, "None");
// assume accountname is always defined properly
credential.setSelectedAccountName(accountName);

httpTransport = AndroidHttp.newCompatibleTransport();
jsonFactory = GsonFactory.getDefaultInstance();
tasksServiceBuilder = new Tasks.Builder(httpTransport, jsonFactory, credential).setApplicationName("App name");
tasksService = tasksServiceBuilder.build();

在开发者控制台中,Tasks API 以 0% 的使用率启用。在凭据中,我有一个使用 SHA1 定义的 Android 应用程序的 OAuth2 客户端 ID,来自 debug.keystore 和定义的包名称。

我错过了什么吗?我还在我的应用程序中获得了一个权限弹出窗口,我接受了 - 但无论出于何种原因,它都没有出现在 https://security.google.com/settings/security/permissions 中。

【问题讨论】:

    标签: android google-api google-api-java-client google-tasks-api


    【解决方案1】:

    所以问题是 debug.keystore 的 SHA1 在开发控制台中是小写的。删除该客户端 ID 并使用大写的 SHA1 创建一个新的 ID 即可解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多