问题描述
我的任务是写IMAP电子邮件客户端的Gmail。到目前为止,我知道,客户应通过OAuth的认证(也有一个<一个href="http://$c$c.google.com/p/google-mail-xoauth-tools/source/browse/trunk/java/com/google/$c$c/samples/xoauth/XoauthAuthenticator.java">java库由谷歌IMAP AUTH )。但我想从任何密码输入设置用户免费。
My task is to write IMAP e-mail client for Gmail. So far I know client should authenticate through OAuth (there's also a java library for IMAP auth by Google). But I'd like to set user free from any password typing.
Android提供了一个很酷的原生的方式来获得的authToken通过的AccountManager谷歌帐户的服务。但我不知道怎么用的authToken又是什么呢?难道只为GAE认证?
Android provides a cool 'native' way to gain authToken for google account services via AccountManager. But I wonder how to use authToken and what is it for? Is it only for GAE authentication?
有没有什么办法让oauthToken和oauthTokenSecret没有浏览器(通过的AccountManager)?
Is there any way to get oauthToken and oauthTokenSecret without browser (via AccountManager)?
推荐答案
您是否尝试过使用 oauth2如下:https://mail.google.com/
为身份验证令牌型( authTokenType
参数)时调用 AccountManager.getAutToken()
?
Have you tried using "oauth2:https://mail.google.com/
" as the "auth token type" (authTokenType
parameter) when calling AccountManager.getAutToken()
?
根据什么说的,在谈谈你提到,它应该工作。
According what is said at 46:50 in the talk you mentioned, it should work.
另外,此页面介绍了如何获得OAuth2令牌谷歌的任务,它有<一个href="http://$c$c.google.com/p/google-api-java-client/source/browse/tasks-android-sample/src/main/java/com/google/api/services/samples/tasks/android/TasksSample.java?repo=samples"相对=nofollow>链接到code样品。这也使得它听起来就像是提供合适的只是一个问题 authTokenType
参数。
By the way, this page describes how to get an OAuth2 token for Google Tasks, and it has a link to a code sample. It also makes it sounds like it is just a matter of providing the right authTokenType
parameter.
这篇关于安卓的AccountManager的authToken和OAuth的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!