使用GoogleApiClient在Android上使用Google App Engine + Authentification

时间:2014-02-18 17:42:52

标签: android google-app-engine authentication oauth-2.0

使用示例https://developers.google.com/+/quickstart/android中的GoogleApiClient,我可以在Android移动设备上使用我的g +帐户登录。

我也可以通过

获取用户ID
Person currentUser = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String id = currentUser.getId();

问题是,如何与GAE上运行的后端服务器建立安全连接?可以通过webview实现它,但我不想这样做。我可以想象,我应该将userId和令牌发送到后端,并从后端验证此令牌是否与用户ID匹配,或类似的东西。

作为示例应用程序,您可以想象一个游戏,到达的杯子保存在后端,并且只能由经过身份验证的用户读取...

谢谢!

0 个答案:

没有答案