Подтвердить что ты не робот

Как получить доступ OAuth к GMail?

Как вы можете получить доступ пользователей к чтению их электронной почты? Кажется, есть OpenID, OAuth, OAuth2 и случайные другие решения.

Лучшее, что я придумал до сих пор, это OAuth2 с scope=https://mail.google.com/.

Есть ли какое-либо разрешение, которое просто даст мне доступ только для чтения к почте и в идеале не пугает пользователя с уведомлением о разрешении, например:

"Просмотр почты и управление ею Выполняйте эти операции, когда я не использую приложение "

Все, что мне хотелось бы, если возможно, "Просмотреть свою почту".

4b9b3361

Ответ 2

Предыдущий ответ более не точен. Недавно выпущенный API Gmail позволяет, среди прочего, использовать область "только для чтения", которая может быть найдена здесь: https://developers.google.com/gmail/api/auth/scopes.

Область "только для чтения": https://www.googleapis.com/auth/gmail.readonly

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.