Gmail & Outlook Integration Guide: Least-Privilege OAuth in Practice

A complete guide to connecting Google Workspace and Microsoft 365 mailboxes safely using scoped OAuth permissions and envelope token encryption.
The Problem with Legacy IMAP/SMTP Credentials
Storing user mail passwords or application-specific passwords on third-party servers presents a catastrophic security vulnerability. Modern cloud platforms must interface exclusively through federated OAuth 2.0 authorization grants.
Google Workspace & Gmail API Architecture
ProxiPilot requests minimal scopes required to sync active threads and compose drafts:
https://www.googleapis.com/auth/gmail.modify: Allows reading thread subjects and drafting replies.https://www.googleapis.com/auth/gmail.send: Enables outbound transmission only when the user explicitly triggers dispatch.
We do not request Google Drive, Contacts, or broad administrative scopes.
Microsoft 365 & Microsoft Graph Architecture
For enterprise Outlook tenants, ProxiPilot leverages Microsoft Graph with tenant-admin consent options, restricting access to delegated mailbox folders. Tokens are encrypted at rest using AES-256 envelope encryption. When a mailbox is disconnected in ProxiPilot settings, stored tokens are purged immediately.


