How can you get user-initiated access to read their email? It seems there is OpenID, OAuth, OAuth2 and random other solutions.
The best I came up with so far is OAuth2 with scope=https://mail.google.com/
.
Is there any permission that would just give me read-only access to the mail and ideally not scare the user with a permission notice like:
"View and manage your mail Perform these operations when I'm not using the application"
All I'd like, if possible "View your mail".
Gmail uses the OAuth 2.0 protocol for authenticating a Google account and authorizing access to user data. You can also use Google Sign-in to provide a "sign-in with Google" authentication method for your app.
The previous answer is no longer accurate. The recently released Gmail API allows a 'read only' scope, among others, which can be found here: https://developers.google.com/gmail/api/auth/scopes.
The 'read only' scope is: 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With