对于Google API Access,我可以为相同的Android程序包名称创建多个客户端ID吗?

时间:2021-04-24 18:58:28

I am following the Quickstart guide here to get Google Drive integration with my android app: https://developers.google.com/drive/quickstart-android .

我按照此处的快速入门指南将Google云端硬盘与我的Android应用集成:https://developers.google.com/drive/quickstart-android。

So I created two Client IDs using the debug and release SHA1 fingerprints for the same package name. The API Console allowed this, but I was wondering since I created the Client ID with the debug key SHA1 fingerprint, will the Google OAuth2 server accept authentication request coming from my release apps?

所以我使用调试创建了两个客户端ID,并为同一个包名释放SHA1指纹。 API控制台允许这样做,但我想知道,因为我使用调试密钥SHA1指纹创建了客户端ID,Google OAuth2服务器是否接受来自我的发布应用程序的身份验证请求?

By the way, I am using Google Play Services API to request auth token, so there's no way to specify the 'Client ID' string shown in the API Console.

顺便说一句,我使用Google Play Services API来请求身份验证令牌,因此无法指定API控制台中显示的“客户端ID”字符串。

1 个解决方案

#1


7  

You don't need to specify the Client ID in your code because your credentials are matched using the package name/SHA1 fingerprint pair, which is unique.

您无需在代码中指定客户端ID,因为您的凭据使用包名称/ SHA1指纹对进行匹配,这是唯一的。

As you generated credentials for both the debug and release certificate, your requests will be authorized correctly as long as your app uses either of those with the package name specified in the APIs Console.

在为调试和发布证书生成凭据时,只要您的应用使用API​​控制台中指定的包名称中的任何一个,您的请求就会被正确授权。

#1


7  

You don't need to specify the Client ID in your code because your credentials are matched using the package name/SHA1 fingerprint pair, which is unique.

您无需在代码中指定客户端ID,因为您的凭据使用包名称/ SHA1指纹对进行匹配,这是唯一的。

As you generated credentials for both the debug and release certificate, your requests will be authorized correctly as long as your app uses either of those with the package name specified in the APIs Console.

在为调试和发布证书生成凭据时,只要您的应用使用API​​控制台中指定的包名称中的任何一个,您的请求就会被正确授权。