为什么我不能为同一个包名称的多个的OAuth 2.0客户端ID? [英] Why can't I create multiple OAuth 2.0 client IDs for the same package name?

查看:174
本文介绍了为什么我不能为同一个包名称的多个的OAuth 2.0客户端ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里教程,它​​说,这是完全可以使用两个的OAuth 2.0客户端ID为同样的包名。

In the tutorial here, it's stated that it's perfectly possible to use two OAuth 2.0 client IDs for the same package name.

您应该创建两个客户ID,一个具有释放证明   指纹,另一个与调试证书指纹。使   一定要使用相同的包名称为。这使得游戏游戏   服务识别从与你签订挂钩的APK电话   无论是证书

You should create two client IDs, one with the release certificate fingerprint and another with the debug certificate fingerprint. Make sure to use the same package name for both. This allows Play Games services to recognize calls from your linked APKs that are signed with either certificate

于是我按照上面的链接教程:先去游戏服务开发者控制台添加新的游戏。于是我加了链接的应用这个游戏,它要求我创建的OAuth 2.0客户端ID。创建我的释放键的SHA1第一个客户端ID后,我找不到任何按钮,创建另一个客户端ID。所以我去云开发者控制台,并发现我可以在这里创建第二个客户端ID在原料药和放大器; AUTH - > 证书。我用我的 debug.keystore 的SHA-1的第二个客户端ID。然后,我编译并同时与调试键和开关键测试我的示例游戏。

So I follow the tutorial in the link above: first go to Game Service in Developer Console, Add a new Game. Then I add a Linked app with this Game, it requires me to create an OAuth 2.0 client ID. After creating the first client ID with my release key's SHA1 , I cannot find any button to create another client ID. So I go to Cloud Developer Console and found out that I can create a second client ID here under APIs & auth-> Credentials. I use my debug.keystore 's SHA1 for this second client ID. Then I compile and test my example game with both the debug key and the release key.

然而,运行之后该应用并试图登录,其结果是,仅在使用释放键(使用第一客户端ID)该应用被接受,使用调试密钥(使用第二客户端ID而该应用)不被接受。

However, after have run the app and attempted to sign in, the result is that only the app using the release key (using the first client ID) is accepted, while the app using the debug key (using the second client ID) is not accepted.

然后我试图删除我的开关键的客户端ID在云开发者控制台(以便调试关键的客户端ID仍然是唯一的客户端ID有),然后再次测试我的应用程序。此时,使用调试密钥该应用已被接受,以及使用该释放键的应用程序是当然不能接受的。

Then I try to delete my release key's client ID in the Cloud Developer Console (so that the debug key's client ID remains as the only client ID there) and test my app again. This time, the app using the debug key is accepted, and the app using the release key is of course not accepted.

那么,这是否意味着我不能为同一个包名创建多个的OAuth 2.0客户端ID?

So does this mean that I cannot create multiple OAuth 2.0 client IDs for the same package name?

推荐答案

由于在相同的解释,在红色警示说明<一href="https://developers.google.com/games/services/console/enabling#step_3_generate_an_oauth_20_client_id">tutorial:

As explained in the red warning note in the same tutorial:

警告:不要从谷歌开发者控制台游戏创建新的客户端ID。如果你这样做了,玩游戏的服务将无法与客户端ID相关联的游戏设置,而这可能会在游戏过程中导致错误。

Warning: Do not create new client IDs for your game from the Google Developers Console. If you do so, Play Games services will not associate your game settings with the client ID, and this could cause errors during gameplay.

相反,在开发者控制台的游戏服务的一部分,转到 2。链接的应用,然后选择链接另一个应用程序,并按照指示那里,给它一个名称,如游戏名称调试和使用调试密钥SHA1 (所有其他字段应该是相同的版本的应用程序)。

Instead, in the Game Service part of the Developer Console, go to 2. Linked Apps and select Link another app and follow the directions there, giving it a name such as 'Game Name Debug' and using your debug key SHA1 (every other field should be the same as your release app).

这篇关于为什么我不能为同一个包名称的多个的OAuth 2.0客户端ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆