2

是否有从外部 Java 程序在网络浏览器上登录 Gmail 帐户的安全方法?我知道以下工作,但有没有更安全的选择?

Desktop.getDesktop().browse(new URI(
        "https://www.google.com/accounts/ServiceLoginAuth?continue=http://mail.google.com/gmail" +
        "&service=mail&Email=LOGIN&Passwd=PASSWORD&null=Sign+in"));

澄清:外部 Java 程序是GmailAssistant,一个已经使用 JavaMail 的 IMAP 功能的 Gmail 通知程序。我只需要一种允许用户直接在网络浏览器中访问帐户的方法。

4

6 回答 6

3

根据您想要集成的程度,您可以查看 Google 单点登录 (SSO) api。我正在研究如何使用它以及集成它的最佳方式

http://code.google.com/apis/apps/sso/saml_reference_implementation.html

胜利者

更新:

作为更好的选择,您还应该检查此链接http://esoeproject.org/

于 2008-09-21T20:57:05.657 回答
2

If you're really wanting to control a browser from Java, you'll have to use a web-connector such as Selenium or WebDriver. Both of these let you control a browser directly from within Java and simulate a user typing text, clicking on links and submitting forms. One thing to keep in mind when doing this with Selenium is that it interacts with a complete new profile which is usually independent of your standard Firefox probile.

于 2008-09-21T21:35:03.210 回答
1

如果您担心该链接在页面中可见,请创建一个向服务器发送 POST 请求的 javascript 文档。

于 2008-09-21T20:52:17.167 回答
1

如果您想以编程方式访问 GMail 帐户的内容,我强烈建议您使用Google 提供的 IMAP 访问

反过来看问题,您可以根据您的 Google 帐户设置OpenID身份验证方案。

于 2008-09-21T20:57:15.597 回答
0

如果您担心为登录而发送的 URL,请了解:

  1. https:// 以 www.google.com 开头,会在之前加密会话
  2. 发送登录详细信息(甚至是它要访问的页面
于 2008-11-20T20:38:34.733 回答
0

我使用 google 的 IMAP 访问和 JavaMail API,非常简单。

于 2008-09-22T14:23:32.600 回答