GCE / Eclipse魔术是否自动添加客户端ID?

时间:2022-12-17 23:10:57

Or put another way...

或换一种方式......

I just moved my app from aaa.appspot.com to a new project (and hence new Client ID) called bbb.appspot.com. When I went to add the new Client Id to my GCE API definitions, it was already there!

我刚将我的应用程序从aaa.appspot.com移动到一个名为bbb.appspot.com的新项目(因此也就是新的客户端ID)。当我将新的客户端ID添加到我的GCE API定义时,它已经存在!

So, on the one hand, it's magic :-)

所以,一方面,这是神奇的:-)

On the other hand, is all of this documented anywhere? I have a slight concern about how I would go about overriding this behaviour if ever I want to manually configure the permitted client IDs.

另一方面,所有这些记录在哪里?如果我想手动配置允许的客户端ID,我对如何重写此行为略有顾虑。

1 个解决方案

#1


1  

I assume you are talking about the API annotations for GCE like this:

我假设您正在讨论GCE的API注释,如下所示:

@ApiMethod(
          name = "testAuth",
    clientIds = { WEB_CLIENT_ID,
            APP1_ANDROID_CLIENT_ID, APP1D_ANDROID_CLIENT_ID,
            APP2_ANDROID_CLIENT_ID },
    audiences = { Config.WEB_CLIENT_ID }        
)

These client ID's come from the API console, where they are created based on your app's package and the hash of your app's certificate.

这些客户端ID来自API控制台,根据您的应用程序包和应用程序证书的哈希值创建它们。

So, you may create a new GAE project for your new app id, and even create a new console project connected to that new GAE project, but your old console project still exists and still has client id's that are specific to your Android project but independent of your GAE project - so they still work.

因此,您可以为新的应用程序ID创建一个新的GAE项目,甚至创建一个连接到该新GAE项目的新控制台项目,但您的旧控制台项目仍然存在,并且仍然具有特定于您的Android项目但独立的客户端ID您的GAE项目 - 所以他们仍然工作。

#1


1  

I assume you are talking about the API annotations for GCE like this:

我假设您正在讨论GCE的API注释,如下所示:

@ApiMethod(
          name = "testAuth",
    clientIds = { WEB_CLIENT_ID,
            APP1_ANDROID_CLIENT_ID, APP1D_ANDROID_CLIENT_ID,
            APP2_ANDROID_CLIENT_ID },
    audiences = { Config.WEB_CLIENT_ID }        
)

These client ID's come from the API console, where they are created based on your app's package and the hash of your app's certificate.

这些客户端ID来自API控制台,根据您的应用程序包和应用程序证书的哈希值创建它们。

So, you may create a new GAE project for your new app id, and even create a new console project connected to that new GAE project, but your old console project still exists and still has client id's that are specific to your Android project but independent of your GAE project - so they still work.

因此,您可以为新的应用程序ID创建一个新的GAE项目,甚至创建一个连接到该新GAE项目的新控制台项目,但您的旧控制台项目仍然存在,并且仍然具有特定于您的Android项目但独立的客户端ID您的GAE项目 - 所以他们仍然工作。