Skip to content
  • There are no suggestions because the search field is empty.

How to Set Up a Google Cloud Project for Google Drive Integration as a Repository Source

This article will help users create a Google OAuth 2.0 Web application client (Client ID + Client secret) for your SaaS so end users can authorize access to their Google Drive.

  1. Create or Select a Google Cloud Project
    • Access the Google Cloud Console and either create a new project (for example, “Google Drive Repo”) or select an existing project that fits your requirements.

      Note: All OAuth credentials, API settings, and the OAuth consent screen are managed at the project level.

  2. Enable the Google Drive API
    • From the left navigation menu, go to APIs & Services > Library. Search for “Google Drive API” and enable it for your chosen project.

  3. Configure the OAuth Consent Screen
    1. Navigate to APIs & Services > OAuth consent screen.

    2. Select the 'Get started' button
    3. Complete the required application information, including App Name and user support email. Add only the minimum Drive API scopes necessary, such as:
      1. https://www.googleapis.com/auth/drive.file: Grants permission to read/write only files created or opened with your app (recommended for least privilege).

        Only use broader full-drive scopes if absolutely necessary.
    4. Select an Audience Type
      1. Internal: Accessible only to users in your Google Workspace domain (requires a Workspace organization).
      2. External: Available to anyone with a Google Account (commonly used for public-facing applications).
    5. Enter emails for those that should receive updates regarding the project
      1. If you intend to use Testing mode, add test user email addresses. Note that Testing mode limits you to 100 users, and tokens expire after 7 days. Save your configuration.

        Important: Some Drive scopes are considered sensitive and may require your app to complete Google’s verification process before going live.
  4. Create OAuth Client Credentials (Web Application)
    1. Go to APIs & Services > Credentials.

    2. Click on Create Credentials > OAuth client ID and select ‘Web application’ as the type.

    3. Add the Authorized JavaScript origins for each relevant hostname. For example:
      • https://<productionBaseURL>
    4. Add the required authorized redirect URIs. For example:
      • https://<productionBaseURL>/ClientFileRepository/OAuthCallback
    5. Once created, securely copy and store the Client ID and Client Secret. Treat the Client Secret as a password. You can generate new secrets or rotate them as needed directly from the OAuth client page.
  1. Switch From Testing to Production (Recommended)
    1. On the OAuth consent screen, select Audience and update the Publishing status to “In production” once verification is complete (if required). This removes the 100-user restriction and the 7-day token limitation. Remaining in Testing mode will maintain those restrictions.

  2. Configure Your Repository in the CRT Platform

Common Issues & How to Avoid Them

  • Skipping the consent screen configuration prevents creation of working OAuth clients for external users.
  • Requesting broader Drive scopes than necessary increases verification complexity.
  • Failing to move to Production restricts you to 100 test users and short-lived tokens.
  • Omitting redirect URIs for all environments causes authentication failures.
  • Consult Google’s official resources for more guidance on scope selection, OAuth best practices, and securing application credentials.