简体   繁体   English

如何在Google App Engine上使用身份验证

[英]How to use authentification on Google App Engine

I'm looking for a good example, documentation or starting point for the following scenario. 我正在寻找以下情况的一个很好的例子,文档或起点。

  1. My own Google App (Java Servlet) running within Google App Engine 我自己的Google App(Java Servlet)在Google App Engine中运行

  2. SSL activated for this app 已为此应用激活SSL

  3. A mobile Android app talking to my Google App 与我的Google App对话的移动Android应用

  4. OAuth or other? OAuth还是其他?

My problem is step 4. Somehow I want to make sure that only my Android app is allowed to talk to my Google App and depending on the user on the mobile device I have to restrict the privileges. 我的问题是第4步。我想以某种方式确保只允许我的Android应用程序与我的Google App对话,并且我必须限制移动设备上的用户,具体取决于移动设备上的用户。

But I couldn't find a "very simple" "easy to start" documentation. 但是我找不到“非常简单”“易于入门”的文档。 Would be glad if someone gives me a hint. 如果有人给我提示会很高兴。 A very short example would be great. 一个非常简短的例子将是很棒的。

The best place to start for this is the Cloud Endpoints documentation. 最好的起点是Cloud Endpoints文档。 This is the best way to implement an API for an Android application, because it auto-generates the serialization/deserialization for you as well as the Android client library code necessary to make the requests. 这是为Android应用程序实现API的最佳方法,因为它会自动为您生成序列化/反序列化以及发出请求所需的Android客户端库代码。 You'll notice as you look through the documentation that you can specify a "User" object as a parameter, which will automatically be injected with the logged-in user. 在浏览文档时,您会注意到可以将“ User”对象指定为参数,该对象将自动随登录用户一起注入。 Furthermore, the "clientIds" and "audiences" allow you to restrict the API to applications which you authorize. 此外,“ clientIds”和“受众”允许您将API限制为您授权的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM