Google Drive Setup Guide¶
This guide walks through enabling Google Drive integration for your university so users can import documents from their Drive into CampusCore knowledge folders.
Prerequisites¶
- A Google Workspace (Enterprise/Education) account with admin access
- Access to the CampusCore Django admin panel (
/admin/) - Your CampusCore instance's public URL (e.g.,
https://campuscore.youruniversity.edu)
Step 1: Create a Google Cloud Project¶
- Go to Google Cloud Console
- Click the project dropdown at the top and select New Project
- Name it something like
CampusCore Integration - Select your organization and click Create
Step 2: Enable the Google Drive API¶
- In your new project, go to APIs & Services > Library
- Search for Google Drive API
- Click Enable
Step 3: Configure the OAuth Consent Screen¶
- Go to APIs & Services > OAuth consent screen
- Select Internal as the user type
- Internal means only users in your Google Workspace organization can authorize — no Google verification needed
- Fill in the required fields:
- App name:
CampusCore - User support email: your IT support email
- Developer contact email: your email
- Click Save and Continue
- On the Scopes page, click Add or Remove Scopes and add: This gives CampusCore read-only access to users' Drive files. It cannot modify or delete any files.
- Click Save and Continue through the remaining steps
Step 4: Create OAuth2 Credentials¶
- Go to APIs & Services > Credentials
- Click + Create Credentials > OAuth client ID
- Application type: Web application
- Name:
CampusCore - Under Authorized redirect URIs, add: Replace with your actual CampusCore URL. For local testing, use:
- Click Create
- Copy the Client ID and Client Secret — you'll need these in the next step
Step 5: Enable Google Drive in CampusCore¶
5a: Enable the Connector¶
- Log in to the CampusCore admin panel at
/admin/ - Navigate to Connectors > Connectors
- Click Google Drive
- Check the Is enabled checkbox
- Click Save
5b: Add OAuth2 Configuration¶
- Navigate to Connectors > Connector Configurations
- Add the following three entries, each with Connector set to
Google Drive:
| Config Key | Value | Is Secret |
|---|---|---|
CLIENT_ID |
Your Google OAuth Client ID (e.g., 123456789.apps.googleusercontent.com) |
No |
CLIENT_SECRET |
Your Google OAuth Client Secret (e.g., GOCSPX-...) |
Yes |
REDIRECT_URI |
https://campuscore.youruniversity.edu/api/connectors/google-drive/callback |
No |
Make sure to check Is secret for the CLIENT_SECRET entry. This ensures it's encrypted at rest and masked in the admin UI.
Step 6: Verify the Setup¶
- Log in to CampusCore as a regular user
- Go to Settings — Google Drive should appear in the Connectors section
- Click Connect — you should be redirected to Google's authorization page
- Authorize access — you should be redirected back to Settings with a success message
- Go to Knowledge Folders, open any folder, and click Import from Cloud
- Google Drive should show a Browse button — click it to verify file listing works
How It Works for Users¶
Once enabled, users can:
-
Connect their account: Go to Settings and click Connect on Google Drive. They authorize CampusCore to read their Drive files via Google's standard OAuth consent screen.
-
Import files: In any Knowledge Folder, click Import from Cloud, select Google Drive, browse their files, and select documents to import. Supported file types: PDF, DOCX, PPTX, and images.
-
Google Docs/Sheets/Slides: Workspace files are automatically exported as PDFs during import since the original formats aren't directly processable.
Users can only access their own Drive files. CampusCore requests read-only access and cannot modify or delete any files in users' Drives.
Troubleshooting¶
"Page not found" on callback¶
Verify the redirect URI is exactly https://your-domain/api/connectors/google-drive/callback (not /connect/google-drive/callback). Update it in both Google Cloud Console and the CampusCore REDIRECT_URI config.
"Missing required configuration" error¶
Check that all three config entries (CLIENT_ID, CLIENT_SECRET, REDIRECT_URI) exist in Connector Configurations and are associated with the Google Drive connector.
"Invalid or expired state parameter"¶
The OAuth state token expires after 10 minutes. If the user takes too long on the Google consent screen, they'll need to try connecting again.
Users outside your organization can't connect¶
If you selected Internal for the OAuth consent screen, only users within your Google Workspace organization can authorize. This is the recommended setting for university deployments.
Token refresh failures¶
If a user's connection shows as "Token Expired", they need to disconnect and reconnect. This can happen if the OAuth client secret is rotated in Google Cloud Console without updating CampusCore's config.