Skip to content

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

  1. Go to Google Cloud Console
  2. Click the project dropdown at the top and select New Project
  3. Name it something like CampusCore Integration
  4. Select your organization and click Create

Step 2: Enable the Google Drive API

  1. In your new project, go to APIs & Services > Library
  2. Search for Google Drive API
  3. Click Enable
  1. Go to APIs & Services > OAuth consent screen
  2. Select Internal as the user type
  3. Internal means only users in your Google Workspace organization can authorize — no Google verification needed
  4. Fill in the required fields:
  5. App name: CampusCore
  6. User support email: your IT support email
  7. Developer contact email: your email
  8. Click Save and Continue
  9. On the Scopes page, click Add or Remove Scopes and add:
    https://www.googleapis.com/auth/drive.readonly
    
    This gives CampusCore read-only access to users' Drive files. It cannot modify or delete any files.
  10. Click Save and Continue through the remaining steps

Step 4: Create OAuth2 Credentials

  1. Go to APIs & Services > Credentials
  2. Click + Create Credentials > OAuth client ID
  3. Application type: Web application
  4. Name: CampusCore
  5. Under Authorized redirect URIs, add:
    https://campuscore.youruniversity.edu/api/connectors/google-drive/callback
    
    Replace with your actual CampusCore URL. For local testing, use:
    http://localhost:8000/api/connectors/google-drive/callback
    
  6. Click Create
  7. 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

  1. Log in to the CampusCore admin panel at /admin/
  2. Navigate to Connectors > Connectors
  3. Click Google Drive
  4. Check the Is enabled checkbox
  5. Click Save

5b: Add OAuth2 Configuration

  1. Navigate to Connectors > Connector Configurations
  2. 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

  1. Log in to CampusCore as a regular user
  2. Go to Settings — Google Drive should appear in the Connectors section
  3. Click Connect — you should be redirected to Google's authorization page
  4. Authorize access — you should be redirected back to Settings with a success message
  5. Go to Knowledge Folders, open any folder, and click Import from Cloud
  6. Google Drive should show a Browse button — click it to verify file listing works

How It Works for Users

Once enabled, users can:

  1. 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.

  2. 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.

  3. 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.