简体   繁体   English

Android Gmail api:如何访问未添加到设备的gmail帐户的gmail帐户

[英]Android Gmail api : How to access a gmail account that is not added to the device s gmail account

While using the Gmail apis is it possible to pass "password" from my app. 使用Gmail API时,可以从我的应用程序传递“密码”。 What i see is that the credentials ( accountname / email and password ) are internally taken from the google accounts added to the device. 我看到的是,凭据(帐户名/电子邮件和密码)是从内部添加到设备的google帐户中获取的。 (Is this understanding correct ). (这种理解是正确的)。 My requirement is to let the user add his email / and password directly in my app .can the user access a gmail account which is not added to devices gmail acccounts. 我的要求是让用户直接在我的应用程序中添加他的电子邮件地址和密码。该用户可以访问未添加到设备gmail帐户中的gmail帐户。

You can use the Gmail REST API to get basic access to any Gmail account which is not registered on the device, but you must use OAuth2 to authenticate the user. 您可以使用Gmail REST API来获得对未在设备上注册的任何Gmail帐户的基本访问权限,但必须使用OAuth2对用户进行身份验证。

Alternatively, you could implement a POP or IMAP client in your app, but the user needs to explicitly enable access in their Gmail account. 另外,您可以在应用中实现POP或IMAP客户端,但是用户需要在其Gmail帐户中明确启用访问权限

It might be helpful if you explain in your question why you need access to the user's email - what does your App do with access to a user's email that a normal email client doesn't? 如果您在问题中解释为什么需要访问用户的电子邮件,这可能会有所帮助-应用程序对普通电子邮件客户端不需要的对用户电子邮件的访问有什么作用?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM