Google Calendar Setup Guide
This guide will walk you through setting up Google Calendar integration step by step. You'll need a Google account and admin access to this app.
Overview
To connect Google Calendar, you need to:
- Create a Google Cloud project
- Enable the Google Calendar API
- Create OAuth credentials
- Add the credentials to this app
- Connect your Google account
- Select calendars to share
Create a Google Cloud Project
First, go to the Google Cloud Console:
https://console.cloud.google.com/Instructions:
- Sign in with your Google account
- Click the project dropdown at the top (next to "Google Cloud")
- Click New Project
- Enter a project name (e.g., "Todo App Calendar")
- Click Create
Tip: Make sure you select the new project from the dropdown before continuing. The project name should appear at the top of the page.
Enable Google Calendar API
Go directly to the Calendar API page:
https://console.cloud.google.com/apis/library/calendar-json.googleapis.comInstructions:
- Make sure your project is selected at the top
- Click the big blue Enable button
- Wait for the API to be enabled (a few seconds)
Configure OAuth Consent Screen
Set up the consent screen:
https://console.cloud.google.com/apis/credentials/consentInstructions:
- Select External user type (unless you have Google Workspace)
- Click Create
- Fill in required fields:
- App name: Todo App (or any name)
- User support email: Your email
- Developer contact: Your email
- Click Save and Continue
- On the "Scopes" page, click Save and Continue (skip adding scopes)
- On the "Test users" page:
- Click + Add Users
- Add your Google email address
- Click Save and Continue
Important: You must add yourself as a test user! Without this, you won't be able to connect your Google account.
Create OAuth Credentials
Create the OAuth client ID:
https://console.cloud.google.com/apis/credentialsInstructions:
- Click + Create Credentials at the top
- Select OAuth client ID
- For Application type, select Web application
- Enter a name (e.g., "Todo App")
- Under "Authorized redirect URIs", click + Add URI
- Enter this exact URL:
http://localhost:5000/calendar/callback - Click Create
Save Your Credentials!
After clicking Create, a popup will show your Client ID and Client Secret. Copy both values - you'll need them in the next step.
Client ID looks like: 123456789-abc123.apps.googleusercontent.com
Client Secret looks like: GOCSPX-abcdef123456
Configure the App
Add the credentials to your environment. Stop the app and restart it with these environment variables:
For macOS/Linux Terminal:
export GOOGLE_CLIENT_ID="your-client-id-here"
export GOOGLE_CLIENT_SECRET="your-client-secret-here"
python app.py
For Windows Command Prompt:
set GOOGLE_CLIENT_ID=your-client-id-here
set GOOGLE_CLIENT_SECRET=your-client-secret-here
python app.py
Or create a .env file:
GOOGLE_CLIENT_ID=your-client-id-here
GOOGLE_CLIENT_SECRET=your-client-secret-here
Connect Your Google Account
- Go to Calendar Settings
- Click Connect Google
- Sign in with the Google account you added as a test user
- Click Continue on the "This app isn't verified" warning
- Grant calendar access permissions
- You'll be redirected back to the app
Note: The "This app isn't verified" warning is normal for development apps. Click "Advanced" and then "Go to [App Name] (unsafe)" to continue.
Select Calendars to Share
- After connecting, your calendars will appear in Calendar Settings
- Select a calendar from the dropdown
- Click Add Calendar
- Repeat for any additional calendars you want to share
- All users can now see events from these calendars on the Calendar page
Troubleshooting
"Error 403: access_denied"
Make sure you added your email as a test user in step 3.
"redirect_uri_mismatch"
Check that the redirect URI in Google Console exactly matches: http://localhost:5000/calendar/callback
"Google OAuth not configured"
Make sure GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET environment variables are set before starting the app.
No calendars showing after connecting
Try disconnecting and reconnecting. Make sure you granted calendar permissions.