登录使用OAuth Gmail的Web界面 [英] Login to Gmail Web Interface using OAuth

查看:230
本文介绍了登录使用OAuth Gmail的Web界面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从的WebView 中访问Gmail网络界面在我的活动。对于明显的安全/信任的原因,我想避免要求用户为他的Gmail的凭据,并将它们存储的地方,而是使用类似的OAuth被授予对Gmail的访问。从我发现,OAuth是只对IMAP和SMTP访问Gmail的账户实施,是否正确?

I need to access the Gmail web interface from within a WebView in my Activity. For obvious security/trust reasons, I'd like to avoid asking the user for his Gmail credentials and storing them somewhere, but rather use something like OAuth to be granted access to Gmail. From what I've found, OAuth is only implemented for IMAP and SMTP-access to the Gmail-Account, correct?

使用 webView.getSettings()会setSavePassword(真); ,并在他第一次让用户登录/她使用的应用程序工作?我怎么会自动在随后的应用快艇提交保存的信息?

Would using webView.getSettings().setSavePassword(true); and letting the user sign in the first time he/she uses the app work? How would I automatically submit the saved details on subsequent app-launches?

谢谢,结果
尼克

Thanks,
Nick

推荐答案

您必须把你的的WebView 作为浏览器。怎么样的Chrome浏览器让你每次访问Gmail的时候可以自动登录?它的Gmail存储会话cookie。

You have to regard your WebView as a browser. How does a browser like Chrome let you be automatically signed in each time you visit Gmail? It stores the session cookies from Gmail.

要存储cookie从的WebView ,下一次重新使用它们,检查出的 CookieManager

To store cookies from your WebView and reuse them the next time, check out CookieManager.

这篇关于登录使用OAuth Gmail的Web界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆