[英]Using google oAuth2 to collect gmail email from java app
I have a web base email client that uses a java app to connect to IMAP and POP3 servers to download email. 我有一个基于Web的电子邮件客户端,该客户端使用Java应用程序连接到IMAP和POP3服务器以下载电子邮件。 There is an issue that if a user usually logs in form the US that the java app will not have access to collect emails until that user logs in from the same county the java app is running.
存在一个问题,如果用户通常以美国身份登录,则该Java应用程序将无法访问收集电子邮件,除非该用户从该Java应用程序所在的县登录。
I was told to overcome this to use google oAuth in order for the account user to give permission to my app to collect emails. 我被告知要克服此问题,请使用google oAuth,以便帐户用户向我的应用授予收集电子邮件的权限。 Is this correct?
这个对吗? Once this has been accomplished I would also like to the the API to import contacts, but for now authorization/authentication is sufficient.
完成此操作后,我还希望API导入联系人,但就目前而言,授权/身份验证就足够了。
The problem I am facing is that after trying to make heads a or tails of the google oAuth api documentation im really confused and did not yet manage to make a working example. 我面临的问题是,在尝试使google oAuth api文档的正面或反面之后,im确实感到困惑,并且尚未设法做出可行的示例。 Documentation often has links to a depreciated API and there is no example with a dowload link to both the API needed and exaple source code, as a result I think im using incorrect libraries for my examples.
文档中经常有指向已贬值的API的链接,没有示例带有同时链接到所需API和示例性源代码的dowload链接,因此我认为我的示例使用了错误的库。
Its also not clear to me what/how to accomplish what is needed do I use client authentication via javascript to create a popup whereby the user grants access? 我也不清楚我需要什么/如何完成需要做的事情,我该如何通过javascript使用客户端身份验证来创建弹出窗口,以便用户授予访问权限?
Or do I use installed app client with a token and secret, this is what I tried but the 'command line' example I tried requires Java EE and this is a native app so I dont see why and I dont want to import all Java EE libraries to my small email downloader app. 还是我将已安装的应用程序客户端与令牌和密码一起使用,这是我尝试过的,但是我尝试过的“命令行”示例需要Java EE,并且这是本机应用程序,所以我看不到原因,也不想导入所有Java EE库到我的小型电子邮件下载器应用程序。
Where can I find more intuitive documentation and working examples on this? 在哪里可以找到更直观的文档和工作示例?
If you stay away from OpenID 2 and OAuth 1, I think the docs are pretty orderly these days. 如果您远离OpenID 2和OAuth 1,我认为这些天文档井井有条。 The best place to start is https://developers.google.com/accounts/docs/OAuth2
最好的起点是https://developers.google.com/accounts/docs/OAuth2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.