我在用着谷歌登录服务 https://developers.google.com/identity/sign-in/android/start对使用我的应用程序的用户进行身份验证。当我刚刚请求电子邮件信息时,我得到了它的工作
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail().build();
然后,我发现我还需要请求 ID 令牌才能通过我的后端进行身份验证,所以我这样做了:
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(String.valueOf(R.string.server_client_id))
.requestEmail().build();
问题是更改后它不会让我登录。我每次尝试登录时不断收到的状态是Status{statusCode=unknown status code: 12501, resolution=null}
.
I've been searching around and I found this post https://stackoverflow.com/questions/33583326/new-google-sign-in-android that is pretty much about the same thing. However, I didn't make any of the mistakes named by the people who answered, the oAuth Client ID in my dev console is for web application:
And R.string.server_client_id
is the first client ID from the picture. the package names are of course correct in all placed otherwise it wouldn't even work without the token request. 2 people also suggested that the app needs to be signed for this to work, but googles documentation says that debug key should work too, and it doesn't make sense to make people sign the apps for debugging.
我几个小时以来一直试图解决这个问题,但没有成功。可能是什么问题呢?请随时索取更多我可能忘记放在这里的信息。