0
A
回答
3
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
if (user != null) {
String email = user.getEmail();
} else {
// no user logged in
}
而且看看文档:http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html
更新:
当然,你需要启用用户authenticaiton在配置中要求用户登录并看到自己的数据:http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication
查看此处查看如何自行登录: http://code.google.com/appengine/docs/java/users/overview.html
相关问题
- 1. 获取主要的gmail帐户状态
- 2. 在Android中获取主要gmail帐户用户名<2.0
- 3. 如何使用PHPmailer在gmail帐户上获取电子邮件
- 4. 无法使用同步Gmail帐户获取联系人
- 5. 通过API获取Gmail帐户上的可用空间python
- 6. cURLing Gmail帐户
- 7. 获取可用的Gmail用户状态
- 8. 获取帐户用户ID FBML
- 9. 获取用户帐户图片
- 10. Chrome扩展程序:获取用户的电子邮件地址登录到Google帐户/ Gmail帐户
- 11. DotNetOpenAuth:用Gmail帐户登录网站
- 12. 使用SMTP注销GMail帐户
- 13. 使用PHPMailer没有Gmail帐户
- 14. 在公司Gmail帐户中使用ActionMailer
- 15. 使用Gmail帐户从iPhone登录
- 16. 使用硒创建Gmail帐户
- 17. 使用Gmail帐户的权限
- 18. 仅通过帐户名称获取Windows用户帐户SID
- 19. 允许用户使用Facebook,Twitter,Gmail应用程序中的Gmail帐户登录
- 20. 从gmail帐户获取所有邮件标签
- 21. 如何从zapier获取gmail帐户信息
- 22. 如何获取我的Gmail帐户的个人资料图片?
- 23. 从Gmail帐户获取个人资料图片
- 24. Gmail PHP API获取错误的帐户电子邮件
- 25. 如何从Gmail帐户中获取未读邮件数
- 26. 获取twilio帐户使用情况按子帐户分组
- 27. 如何使用推送通知从Gmail帐户获取新邮件通知
- 28. 使用Gmail中的Gmail帐户发送邮件
- 29. 登录到Gmail帐户
- 30. C2DM - 限制Gmail帐户
只返回null,我需要重定向用户登录他的谷歌帐户,并重新导向到我的应用程序,我有一个URL,但只返回一个令牌,我真的不知道,并且无法找到如何使用它, http://www.google.com/a/sanmina-sci.com/AuthSubRequest?scope=http://www.google.com/m8/feeds/&session=1&secure=0&next=http://www.example。 com/welcome.html – Charlires 2011-03-29 15:18:49
您必须配置您的应用程序以要求认证 - 请参阅更新的答案。 – 2011-03-31 08:58:23