Google Workspace Integration in Frappe Framework v15
Google Workspace integration in Frappe Framework v15 allows secure OAuth-based connectivity with Gmail, Google Calendar, and Google Login for enterprise-grade collaboration and automation.
This guide explains what Google Workspace integration is, why it matters, and how to configure it correctly in Frappe v15, using only verified APIs and configurations from the official Frappe repository.
What Is Google Workspace Integration in Frappe?
Google Workspace integration in Frappe enables OAuth 2.0–based authentication and API access to Google services such as Gmail and Calendar directly from a Frappe application.
It allows users to:
- Log in using Google accounts
- Send and read emails via Gmail API
- Sync events with Google Calendar
- Securely authorize access without storing passwords
This integration is native to Frappe Framework v15 and managed through built-in OAuth mechanisms.
Why Use Google Workspace Integration in ERPNext & Frappe?
Google Workspace integration is essential for modern ERP and business apps built on Frappe because it:
- Eliminates manual email configuration
- Improves user experience with Google Login
- Enables secure API-based email and calendar access
- Supports enterprise OAuth compliance
- Reduces dependency on SMTP passwords
This is particularly valuable for ERPNext, CRM, Helpdesk, and Workflow-driven applications.
- Target Audience
- ERPNext Developers
- Frappe Framework Developers
- System Administrators
- ERP Consultants
- DevOps Engineers managing Frappe v15 stacks
Technical Prerequisites
Before configuring Google Workspace integration, ensure:
- Frappe Framework Version 15
- Bench-based deployment
- HTTPS-enabled site
- Google Workspace or Google Cloud account
- Administrator access to Frappe and Google Cloud Console
How Does OAuth Work in Frappe v15?
Frappe uses OAuth 2.0 authorization flow to connect with Google APIs securely.
Key OAuth components in Frappe v15:
- Social Login Key DocType
- OAuth Redirect URI
- Token-based authorization
- Scoped API access
Frappe never stores Google passwords—only encrypted OAuth tokens
Step-by-Step: Configure Google Workspace Integration in Frappe v15
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project
- Enable required APIs:
- Gmail API
- Google Calendar API
- Google People API (for login)
Step 2: Configure OAuth Consent Screen
What is the OAuth Consent Screen?
It defines how Google asks users to approve access.
Configuration tips:
- User Type: Internal (recommended for Workspace)
- Application Name: Your Frappe App
- Authorized Domains: Your site domain
- Scopes: Only required scopes (principle of least privilege)
Step 3: Create OAuth Credentials
Create OAuth Client ID with:
- Application Type: Web Application
Authorized Redirect URI:
https://<your-site>/api/method/frappe.integrations.oauth2.login
This endpoint is hardcoded and verified in Frappe v15.
Step 4: Configure Social Login Key in Frappe
Navigate to:
Desk → Social Login Key
Create a new entry:
| Field | Value |
| Provider Name | |
| Client ID | From Google Console |
| Client Secret | From Google Console |
| Base URL | |
| Icon | |
| Enabled | ✔ |
Scopes are stored securely and validated during authorization.
How Google Login Works in Frappe v15
Google Login allows users to authenticate using their Google account instead of a Frappe password.
Process flow:
- User clicks Login with Google
- Google OAuth consent screen appears
- User approves access
- Frappe validates token
- User account is created or linked automatically
This logic is handled internally by Frappe’s OAuth framework.
Gmail Integration in Frappe Framework v15
Frappe integrates with Gmail using the Gmail REST API.
Supported capabilities:
- Send emails via Gmail API
- Track sent messages
- Avoid SMTP configuration
- Use user-authorized Gmail accounts
Gmail API tokens are stored per user and refreshed automatically.
Google Calendar Integration in Frappe
Google Calendar integration enables event creation and syncing from Frappe.
- Typical use cases:
- Meeting scheduling
- Task reminders
- CRM follow-ups
- ERP activity planning
Calendar access respects OAuth scopes and user permissions.
Best Practices for Google Integration in Frappe
- Use minimal OAuth scopes
- Prefer Internal apps for Workspace
- Rotate credentials periodically
- Enforce HTTPS
- Monitor API quota usage
- Use separate projects for staging and production
Common Issues & Troubleshooting
Issue: Redirect URI mismatch
Solution: Ensure the redirect URI matches exactly:
/api/method/frappe.integrations.oauth2.login
Issue: Login works but email fails
Solution: Enable Gmail API and verify gmail.send scope.
Issue: Token expired
Solution: Frappe auto-refreshes tokens. Check if the refresh token scope is allowed.
Integration Patterns & Use Cases
- ERPNext Email Automation via Gmail API
- CRM Lead Follow-ups with Google Calendar
- Helpdesk Email Sync
- Employee Login via Google Workspace
- Workflow-triggered notifications
Summary
Google Workspace integration in Frappe Framework v15 provides secure, scalable, and enterprise-ready authentication and API connectivity using OAuth 2.0.
When configured correctly, it enhances productivity, security, and user experience across ERPNext and custom Frappe applications.