App Engine API 和密钥

App Engine API and Secret Key

我需要为 Google App Engine 上的 Web 服务设置 API 密钥和 API 机密。我的目标是让第三方应用程序提供这两个密钥来访问 Web 服务。第三方应用可以写成PHP或Java等。我的 App Engine 应用程序是用 Java.

编写的

在 Stack Overflow 上未发现类似问题。我可能做错了。期待收到您的来信。

在 Google Cloud Endpoints documentation there is a Choosing an Authentication Method section. Also look at Why and When to Use API Keys 中,他们解释说:

API keys are for projects, authentication is for users

Google Cloud Endpoints handles both API keys and authentication schemes (such as Firebase or Auth0). The main distinction between these two is:

  • API keys identify the calling project — the app or site — making the call to an API

  • Auth tokens identify a user — the person — that is using the app or site .....

通常有很多文档解释身份验证方法之间的差异以及如何使用它们(见下图)。

如果您确定自己需要什么,Restricting API Access with API Keys 是正确的选择。