---
title: Configure an OAuth service account for Google Drive ingestion
description: Configure OAuth service account authentication for Google Drive ingestion into Databricks by creating a service account key and sharing source content.
canonical_url: https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/google-drive-source-setup-service-account
---

# Configure an OAuth service account for Google Drive ingestion

An OAuth service account authenticates Google Drive ingestion into Databricks as a Google service account rather than an individual user.

> [!TIP]
>
> If you only need to ingest files that a single person can access, [OAuth U2M: Databricks-managed](https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/google-drive-source-setup-u2m-databricks-managed.md) requires no Google Cloud setup.

## Prerequisites

* A Databricks workspace with Unity Catalog enabled.
* The `CREATE CONNECTION` privilege on the metastore.
* A Google Cloud project with the Google Drive API enabled. To enable it, go to **APIs & Services > Library** in the [Google Cloud console](https://console.cloud.google.com), search for "Google Drive API", then select **Enable**.

## <a id="create-service-account" />Step 1: Create a service account and key

1. On the Google Cloud console home screen, go to **IAM & Admin > Service Accounts**.

2. Select **Create service account**.

3. Enter a service account name (for example, `databricks-google-drive`), then select **Create and continue**.

4. Skip the optional role and user access steps, then select **Done**.

5. On the **Service accounts** page, select the service account you created.

6. On the **Keys** tab, select **Add key > Create new key**.

7. For **Key type**, select **JSON**, then select **Create**.

   This downloads the service account key in JSON format. Store it securely: it grants access to the data the service account can read, and Google doesn't let you download it again.

8. Record the service account's email address, shown on the **Details** tab. You use it to share Google Drive content in the next step.

## <a id="grant-service-account-access" />Step 2: Grant the service account access to your Google Drive content

In Google Drive, share each file, folder, or shared drive you want to ingest with the service account's email address, granting at least **Viewer** access. The connector can ingest only content shared with the service account.

> [!NOTE]
>
> The connector requests read-only scopes and cannot modify or delete data in Google Drive.

## Next steps

1. [Create a connection](https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/google-drive-connection.md) to store the authentication details that you've obtained.
2. [Create an ingestion pipeline](https://docs.databricks.com/gcp/en/ingestion/lakeflow-connect/google-drive-pipeline.md).
