Google App Engine远程API + OAuth

Tza*_*ach 5 python google-app-engine oauth-2.0 google-oauth

我正在使用GAE远程api来访问我的应用程序的数据存储.GAE的认证是使用remote_api_stub.ConfigureRemoteApi返回用户名和密码的认证功能进行的.

有没有办法使用access_token进行身份验证,例如OAuth或OAuth 2.0?

cjl*_*ana 3

有一个针对配置为使用两步验证的 Google 帐户的解决方案。

\n\n

目前,您可能会看到抛出 \xe2\x80\x9cBadAuthentication InvalidSecondFactor" 错误,因为您无法从 shell 正确登录。

\n\n

为了解决这个问题,您将需要一个应用程序密码来授权应用程序访问您的帐户资源。按照教程操作,并使用生成的密码和目标 App Engine 应用程序管理员的用户名作为远程 API 的凭据。

\n\n

更新:

\n\n

此外,您可以查看remote_api_stub.pyAppEngine SDK 中的您将找到一系列名为 _ConfigureRemoteApiWith* 的方法(注意前导下划线),例如:

\n\n
    \n
  • _ConfigureRemoteApiWithKeyFile
  • \n
  • _ConfigureRemoteApiWithComputeEngineCredential
  • \n
  • _ConfigureRemoteApiWithOAuthCredentials
  • \n
\n\n

方法本身有详细的文档记录,请查看它们的文档字符串。它们将让您使用比remote_api_stub.ConfigureRemoteApi() 提供的通常ASP 更安全的方法进行身份验证。

\n