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
- Go to Google Cloud Console
- Click "Select a project" → "New Project"
- Enter a project name (e.g., "BAP Storage")
- Click "Create"
- Wait for the project to be created
Step 2: Enable the Drive API
- In the Google Cloud Console, navigate to APIs & Services → Library
- Search for "Google Drive API"
- Click on it and click "Enable"
- Wait for the API to be enabled
Step 3: Configure OAuth Consent Screen
- Navigate to APIs & Services → OAuth consent screen
- Select "External" (not Internal)
- Fill in the required fields:
| Field | Value |
|---|---|
| App name | BAP Storage (or your app name) |
| User support email | Your email address |
| Developer contact email | Your email address |
- Click "Save and Continue"
- Skip the "Scopes" step (no special scopes needed)
- Skip the "Test users" step (or add yourself)
- Click "Back to Dashboard"
Step 4: Create OAuth Credentials
- Navigate to APIs & Services → Credentials
- Click "Create Credentials" → "OAuth client ID"
- Select "Web application" as the application type
- Fill in the details:
| Field | Value |
|---|---|
| Name | BAP Web Client |
| Authorized JavaScript origins | http://localhost:3000 (for development) |
| Authorized redirect URIs | http://localhost:8080/api/storages/oauth/callback |
- Click "Create"
- A modal will appear with your Client ID and Client Secret
- 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:
- Go back to Credentials
- Click on your OAuth client
- Under "Authorized redirect URIs", add:
https://yourdomain.com/api/storages/oauth/callback - Under "Authorized JavaScript origins", add:
https://yourdomain.com - Click "Save"
Important URLs
These are the URLs you'll need for BAP configuration:
| URL | Value |
|---|---|
| Redirect URI | https://yourdomain.com/api/storages/oauth/callback |
| JavaScript Origin | https://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