Google Direct OAuth
Access Google Calendar and Gmail directly using your own OAuth credentials — no third-party apps involved.
What This Does
- Creates your own OAuth client in Google Cloud Console
- Stores credentials locally on your Zo Computer (
/home/.z/google-oauth/) - Runs a background daemon that refreshes tokens every 4 hours
- Provides Python helpers for Zo to access your Calendar and Gmail
Setup Instructions
Step 1: Create a Google Cloud Project
- Go to console.cloud.google.com/projectcreate
- Name it anything (e.g., "My Zo App")
- Click Create
Step 2: Enable the APIs
- Go to APIs & Services > Library
- Search for and enable (required for Gmail/Calendar/Drive/Docs/Sheets/Contacts):
- Google Calendar API
- Gmail API
- Google Drive API
- People API (Contacts)
- Google Docs API
- Google Sheets API
- Optional (only if you plan to use these features):
- Google Tasks API
- Google Chat API (Workspace only)
- Google Classroom API (Education/Workspace)
- Cloud Identity API (Groups, Workspace)
- Google Keep API (Workspace; requires service account + delegation)
Step 3: Configure OAuth Consent Screen
- Go to OAuth consent screen
- Choose External (unless you have Google Workspace)
- Fill in:
- App name: anything (e.g., "Zo Google Access")
- User support email: your email
- Developer contact: your email
- Click Save and Continue through scopes
- Test users: Add your Gmail address
- Save and continue
Step 4: Create OAuth Credentials
- Go to Credentials
- Click + Create Credentials → OAuth client ID
- Application type: Web application
- Name: anything
- Authorized redirect URIs: Add your Zo callback URL (Zo will tell you this)
- Click Create
- Download the JSON file (you'll upload this to Zo)
Step 5: Switch to Production Mode (Important!)
- Go back to OAuth consent screen
- Click Publish App
- This makes your refresh tokens long-lived (otherwise they expire in 7 days)
Step 6: Run the Skill
Tell Zo:
"Set up Google Direct OAuth with this credentials file"
And upload/attach the JSON file you downloaded.
Zo will:
- Store your credentials
- Spin up a temporary OAuth callback site
- Give you a link to authorize
- Store the tokens and start the refresh daemon
After Setup
Once connected, Zo can access your Google Calendar and Gmail directly. Examples:
- "What's on my calendar today?" (uses direct Google Calendar API)
- "Read my recent emails" (uses direct Gmail API)
These credentials are stored in /home/.z/google-oauth/ and can be reused by other skills
like gog by pointing gog auth credentials at client_secret.json.
Files
| Path | Purpose |
|---|---|
/home/.z/google-oauth/client_secret.json |
Your OAuth client credentials |
/home/.z/google-oauth/token.json |
Access + refresh tokens |
/home/.z/google-oauth/google_auth.py |
Python helper for Zo |
/home/.z/google-oauth/refresh-daemon.py |
Background token refresher |
Services
The skill registers a background service google-oauth-refresh that keeps tokens fresh every 4 hours.
Revoking Access
To disconnect:
- Go to Google Account Permissions
- Find your app and click Remove Access
- Delete
/home/.z/google-oauth/on your Zo