Google 的 403 响应登录 Android

403 Response for Google Login on Android

当我执行 Google+ 登录时,我在签名的 APK 上收到以下错误:

Unexpected response code 403 for https://www.googleapis.com/plus/v1/people/me

使用我的密钥库、别名和密钥库密码为我签名的 APK 生成了 SHA1 指纹,并将其添加到 Google Plus 开发者控制台,但我仍然收到错误。

我做错了什么?

我的调试版本运行正常。

我在 logcat

中收到以下错误
10-02 09:31:28.460   7089-13931/? E/MDM﹕ [230] b.run: Couldn't connect to Google API client: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-02 09:31:31.964  22172-22356/? E/Volley﹕ [2260] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/plus/v1/people/me

另外,当我尝试使用 Plus.PeopleApi.loadConnected(... 请求加载朋友时,我收到以下错误:

Status{statusCode=NETWORK_ERROR, resolution=null}

我认为这与我当时的 SHA1 有关,但我不认为我在生成它时做错了什么。

错误 403 意味着 Forbidden/or 没有权限使用给定的登录凭据访问 page/site。

此外,您的 apk 的签名版和调试版会得到不同的 SHA-1, 请记住这一点。

以下是我从中获取的信息。 https://developers.google.com/+/sign-in-faq

出现 403 错误的原因

403 - Forbidden

Refer to the API's quota in the Google Developer Console to ensure your application is not exceeding the request quota.

Ensure Google+ API is enabled in the Developer Console for the application you are testing.

Confirm the requested scopes correspond to what is required to invoke the API.

Verify that this is not a rare case of requesting a user's circle data while the user is a Google App user who has disabled Google+.

不要忘记从您的开发控制台使用 Oauth 2.0