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