首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何获得GMail的OAuth访问权限?

如何获得GMail的OAuth访问权限?
EN

Stack Overflow用户
提问于 2013-01-01 11:02:13
回答 2查看 13K关注 0票数 11

如何获得用户发起的访问权限以阅读他们的电子邮件?似乎有OpenID,OAuth,OAuth2和随机的其他解决方案。

到目前为止,我想出的最好的方案是使用scope=https://mail.google.com/的OAuth2。

有没有什么权限可以让我只读访问邮件,而且最好不会用如下的权限通知吓到用户:

“查看和管理您的邮件在我不使用应用程序时执行这些操作”

我只想,如果可能的话,“查看你的邮件”。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-01 11:21:13

The GMail API documentation说,只有一个作用域可以访问所有内容。

还有一个叫做GMail Inbox Feed的功能,它可能是你想要的,但它只在Google Apps域名上可用。

票数 4
EN

Stack Overflow用户

发布于 2014-07-25 07:07:09

以前的答案不再准确。最近发布的Gmail API允许一个“只读”的作用域,可以在这里找到:https://developers.google.com/gmail/api/auth/scopes

“只读”作用域是:https://www.googleapis.com/auth/gmail.readonly

代码语言:javascript
运行
复制
https://www.googleapis.com/auth/gmail.readonly
Read all resources and their metadata—no write operations.

https://www.googleapis.com/auth/gmail.compose
Create, read, update, and delete drafts. Send messages and drafts.

https://www.googleapis.com/auth/gmail.send
Send messages only. No read or modify privileges on mailbox.

https://www.googleapis.com/auth/gmail.insert
Insert and import messages only.

https://www.googleapis.com/auth/gmail.labels
Create, read, update, and delete labels only.

https://www.googleapis.com/auth/gmail.modify
All read/write operations except immediate, permanent deletion of threads and messages, bypassing Trash.

https://www.googleapis.com/auth/gmail.metadata
Read resources metadata including labels, history records, and email message headers, but not the message body or attachments.

https://www.googleapis.com/auth/gmail.settings.basic
Manage basic mail settings.

https://www.googleapis.com/auth/gmail.settings.sharing
Manage sensitive mail settings, including forwarding rules and aliases. 

Note: Operations guarded by this scope are restricted to administrative use only. They are only available to G Suite customers using a service account with domain-wide delegation. 

https://mail.google.com/
Full access to the account, including permanent deletion of threads and messages. This scope should only be requested if your application needs to immediately and permanently delete threads and messages, bypassing Trash; all other actions can be performed with less permissive scopes.
票数 12
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14107563

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档