【问题标题】:AppIdentityService for appengine 2 appengine authentication用于应用引擎 2 应用引擎身份验证的 AppIdentity 服务
【发布时间】:2013-07-03 01:15:55
【问题描述】:

我对提供 appengine 服务器 2 服务器身份验证的新机制感到困惑。

我有 2 个应用程序。应用 1 和应用 2。 App1 通过安全的 Restful 界面与 App2 交互。

App2 接口在 web.xml 中以管理员角色保护。

<security-constraint>
<web-resource-collection>
<url-pattern>/V3/publish/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>

我将 App1 应用程序身份添加到 App2 管理员列表。

然后 App1 只需使用服务器应用程序标识调用接口。 根据下面的链接,应用程序身份 API 应该可以帮助我。

https://developers.google.com/appengine/docs/java/appidentity/

这似乎只适用于“google API”应用而不是其他系统(即用户应用引擎应用)。

第一季度。我可以使用 AppIdentityService 使用 auth_contraint 角色以安全的方式调用另一个 appengine 应用程序吗?

感谢任何帮助。

-lp

【问题讨论】:

    标签: java google-app-engine google-oauth


    【解决方案1】:

    您不能将应用程序身份添加到另一个应用程序管理员列表。 (您邀请的电子邮件必须接受邀请)。

    您可以使用 AppIdentityService 使用应用程序的公钥/私钥对内容进行签名(由 Google 管理,包括密钥轮换),请参阅 Asserting identity to other systems 以及一些示例代码:Google App Engine Security Module API and JWT support

    【讨论】:

      【解决方案2】:

      也许'X-Appengine-Inbound-Appid' 对你来说已经足够了。在 App Engine 中设置为 App Engine 请求,不能在外部请求中设置。

      我们在 Python 中使用这样的东西:

      app_id = self.request.headers.get('X-Appengine-Inbound-Appid', None)
      if app_id not in {'some', 'other'}:
          logging.warn(u'Callback from strange caller: %s', app_id)
          ....
      else:
          ....
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多