Using Google Oauth2, the following scope is used to get API-access to a users email: https://mail.google.com/
Testing the scope via OAuth 2.0 Playground confirms that the app wants to "View and manage your email":
Is there a way to only ask for access to send emails on behalf of the user? A more specific scope perhaps?
What is OAuth2 scope? OAuth 2.0 scopes provide a way to limit the amount of access that is granted to an access token. For example, an access token issued to a client app may be granted READ and WRITE access to protected resources, or just READ access.
What are sensitive API scopes? Sensitive scopes allow access to Google User Data. If an app uses sensitive scopes, it must comply with the Google API User Data Policy or product specific User Data policy and have its OAuth consent screen configuration verified by Google.
You don't necessarily need OAuth2 scopes, and you can handle authentication and authorization however you want. But OAuth2 with scopes can be nicely integrated into your API (with OpenAPI) and your API docs.
The scope is the same if you use OAuth through SMTP or IMAP. But Google released new set of scopes (https://developers.google.com/gmail/api/auth/scopes) for Gmail API access. Here they are:
You can try using the 5th one and see if it works for you.
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