BAPBA Protocol
GuidesHost Guides

Google Drive Setup

Step-by-step guide to creating Google Cloud OAuth credentials for BAP storage.

Google Drive Setup

This guide walks through creating OAuth credentials to connect Google Drive as a storage backend for BAP.

Prerequisites

  • A Google Account
  • Access to Google Cloud Console (free tier works)

Step 1: Create a Google Cloud Project

  1. Go to Google Cloud Console
  2. Click "Select a project""New Project"
  3. Enter a project name (e.g., "BAP Storage")
  4. Click "Create"
  5. Wait for the project to be created

Step 2: Enable the Drive API

  1. In the Google Cloud Console, navigate to APIs & ServicesLibrary
  2. Search for "Google Drive API"
  3. Click on it and click "Enable"
  4. Wait for the API to be enabled
  1. Navigate to APIs & ServicesOAuth consent screen
  2. Select "External" (not Internal)
  3. Fill in the required fields:
FieldValue
App nameBAP Storage (or your app name)
User support emailYour email address
Developer contact emailYour email address
  1. Click "Save and Continue"
  2. Skip the "Scopes" step (no special scopes needed)
  3. Skip the "Test users" step (or add yourself)
  4. Click "Back to Dashboard"

Step 4: Create OAuth Credentials

  1. Navigate to APIs & ServicesCredentials
  2. Click "Create Credentials""OAuth client ID"
  3. Select "Web application" as the application type
  4. Fill in the details:
FieldValue
NameBAP Web Client
Authorized JavaScript originshttp://localhost:3000 (for development)
Authorized redirect URIshttp://localhost:8080/api/storages/oauth/callback
  1. Click "Create"
  2. A modal will appear with your Client ID and Client Secret
  3. Copy and save these values — you'll need them for BAP

Step 5: Configure for Production

When you're ready to deploy to production, add your production domain:

  1. Go back to Credentials
  2. Click on your OAuth client
  3. Under "Authorized redirect URIs", add:
    https://yourdomain.com/api/storages/oauth/callback
  4. Under "Authorized JavaScript origins", add:
    https://yourdomain.com
  5. Click "Save"

Important URLs

These are the URLs you'll need for BAP configuration:

URLValue
Redirect URIhttps://yourdomain.com/api/storages/oauth/callback
JavaScript Originhttps://yourdomain.com

Replace yourdomain.com with your actual domain.

Troubleshooting

"Invalid client ID" error

  • Verify you're using the correct Client ID
  • Check that the Google Drive API is enabled
  • Ensure the redirect URI matches exactly

"Access denied" error

  • Check that OAuth consent screen is configured
  • Verify your email is added as a test user (for unpublished apps)

Redirect URI mismatch

  • The redirect URI in BAP must match exactly what's in Google Cloud Console
  • Include https:// even if your site uses SSL
  • No trailing slashes

Credentials not working

  • Verify the OAuth client is "Published" or you're a test user
  • Check that the Client Secret is correct (not just the ID)

Security Notes

  • Keep your Client Secret secret — don't share it publicly
  • Limit authorized domains — only add domains you control
  • Rotate credentials periodically — create new credentials and delete old ones

Next Steps

  • Return to Connecting Storage to complete the setup
  • Add your Client ID and Client Secret in the BAP dashboard

On this page