Skip to main content
Version: 3.2.0

feat-gmail-oauth

✨ New Features​

[Gmail Google-account OAuth]​

Goal: Read one Gmail mailbox with a user refresh token, like n8n, without domain-wide delegation.

Solution: Email Gmail sources accept auth: oauth. The wizard opens Google consent (access_type=offline). Tower stores the refresh token in token and mints an access token on each poll.

Features:

  • Wizard: IMAP, Google DWD, or Google account. Test connection opens Google consent when there is no refresh token yet.
  • Client id/secret from the form, or GMAIL_OAUTH_CLIENT_ID / GMAIL_OAUTH_CLIENT_SECRET
  • Redirect https://<tower>/api/v1/config/gmail/oauth/callback (activation public URL)
  • Poll uses the refresh token; empty mailbox still refreshes it

Implementation Details:

  • No impersonation: users/me is the consented account. Test connection rejects a mailbox that does not match.
  • Consent popup posts a one-shot session id; the UI fetches the refresh token with the Tower session.

Files Modified:

  • src/protocol/source/email/gmail.client.ts - refresh-token access
  • src/protocol/source/email/gmail.oauth.service.ts - start / callback / session
  • src/protocol/source/email/gmail.oauth.controller.ts - consent routes
  • ui/src/pages/workflows/stepForms/StepInitForm.tsx - Google account; Test connection starts consent
  • ui/src/protocol/tower.mock.ts - demo source Gmail inbox and OAuth start/session
  • docs/user/configuration/gmail-dwd.md - domain-wide delegation how-to (EN / FR)
  • docs/user/configuration/gmail-oauth.md - Sign in with Google how-to (EN / FR)