> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getunblocked.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive for Workspaces

> Connecting your Google Workspace's Drive to Unblocked

Connecting your Google Workspace's Drive to Unblocked unlocks the following capabilities:

* **Content Configurability:** Select all current and future content in your workspace, or specific files, folders, or drives to connect to Unblocked.
* **Identity Awareness:** Understand the permission structure of each document without requiring every individual user to link their account.
* **Personal Drive Content:** Allow users to ask Unblocked about their personal drive content, provided that [Data Shield](/team-settings/data-shield) is enabled.

## Connecting to Unblocked

<Note>
  Connecting your Google Workspace must be done by a **Google Super Admin** in
  the organization.
</Note>

Navigate to the [Unblocked web app](/using-unblocked/on-the-web) and authenticate with Unblocked.

Once you've signed in, click **Settings** in the sidebar, then **Data Sources**, then **Connect another data source**. Scroll to the documentation section and select **Google Drive for Workspaces**.

To connect your Google Workspace's Drive with Unblocked, you will need to follow a series of steps in the Google Cloud Admin Console.

<Steps titleSize="h2">
  <Step title="Create a Project">
    Follow the link to the **Google Cloud Console** and click **Create project**. Fill out the form, ensuring that the domain matches the email address of your organization, and click **Create**.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-2.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=b639f558fddf8be310e06d3b48f413e8" alt="Connect-Google-Drive" width="1320" height="1046" data-path="img/g-workspace-2.png" />

    Click **Select Project** to navigate to the project you just created.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-3.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=c4e377f9bcd7a106b45f25b95f97fc2b" alt="Connect-Google-Drive" width="2058" height="840" data-path="img/g-workspace-3.png" />

    Copy your newly created Project ID.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-4.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=3840ba0149d84f909c8d306ed19c8e1d" alt="Connect-Google-Drive" width="1888" height="1074" data-path="img/g-workspace-4.png" />

    Head back to Unblocked and paste it into the Project ID field in the Unblocked form. This will reveal the additional steps necessary to connect Google Drive.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-5.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=d4a5404b28e975b05e776297d44382db" alt="Connect-Google-Drive" width="1478" height="824" data-path="img/g-workspace-5.png" />
  </Step>

  <Step title="Enable Google APIs">
    Follow every link provided in the list and enable each API for your new project. This grants Unblocked the ability to process the contents of your Drive and sync user permissions.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-7.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=5cc8becc18fdcec20f833b8f73765f47" alt="Connect-Google-Drive" width="1760" height="872" data-path="img/g-workspace-7.png" />
  </Step>

  <Step title="Create a Service Account Private Key">
    Follow the link to the **IAM & Admin Service Accounts** page, and click on your new project. On the Service Accounts page, click **Create service account**. Fill out the form and select **Done**.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-9.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=77a082e7701d5f783a5f7bc512ae6443" alt="Connect-Google-Drive" width="2060" height="1400" data-path="img/g-workspace-9.png" />

    Click on your newly created Service Account, and navigate to the **Keys** tab. Click the **Add key** dropdown, and select **Create new key**.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-11.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=e7b2d46af7eeaa8ddbf36fc7d72e8bbd" alt="Connect-Google-Drive" width="2000" height="1128" data-path="img/g-workspace-11.png" />

    When prompted, choose the JSON option and click **Create**.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-12.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=7fa5633b0e8251a6aa0c690174d11c05" alt="Connect-Google-Drive" width="1480" height="1032" data-path="img/g-workspace-12.png" />

    A JSON key will be generated and downloaded to your machine. Open this key and **copy and paste the contents into Private Key field** in Unblocked.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-13.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=c3a8d78db4aeb4cf56916baf77618daa" alt="Connect-Google-Drive" width="1478" height="1071" data-path="img/g-workspace-13.png" />

    #### Troubleshooting Key Creation

    Depending on the settings of your Google Workspace, you may see the following error when trying to create a new Service Account key.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-error-1.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=52e4d0e9ac886832870f32dd902a88cb" alt="Connect-Google-Drive" width="1960" height="1280" data-path="img/g-workspace-error-1.png" />

    Ensure that you have [enabled service account key creation](/data-sources/google-drive-for-workspaces#enabling-key-creation) for your workspace before proceeding.
  </Step>

  <Step title="Add the Service Account to your workspace">
    Follow the link to the **Domain-wide Delegation** section of your Google Cloud Console. Create a new API client by clicking **Add new**.

    Copy the `client_id` property of the generated Service Account key created in Step 3, and paste the id into the Client ID field. Paste the contents of the of OAuth scopes provided by Unblocked into the second input field.

    <img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-14.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=b3f4758c53fc590af8cad5c04ea8bbe6" alt="Connect-Google-Drive" width="1680" height="1200" data-path="img/g-workspace-14.png" />
  </Step>

  <Step title="Enter your Super Admin Email">
    <Note>
      Unblocked recommends using a Super Admin email to sync all users, groups, group memberships, and content permissions from your Workspace.

      However, if you prefer to use a non-Super Admin email, you can instead [create a custom admin role](/data-sources/google-drive-for-workspaces#creating-a-custom-admin-role).
    </Note>

    Lastly, enter a valid email address into the Email field of the Unblocked form.

    Click **Validate Connection** to complete setup and connect your Google Workspace with Unblocked.
  </Step>
</Steps>

## Configuring Google Drive

By default, Unblocked will reference **all the contents** of the connected Google Workspace to answer questions.

Choose **Specific Files, folders, and drives** to search for and select specific content for Unblocked to reference.

<img src="https://mintcdn.com/unblocked/vkkTR4Jwhgb5cfSq/img/g-workspace-16.png?fit=max&auto=format&n=vkkTR4Jwhgb5cfSq&q=85&s=d7f3d2be215a3c10387827868c8a7d36" alt="Connect-Google-Drive" width="2880" height="1820" data-path="img/g-workspace-16.png" />

Click **Save Settings** to save your changes. Unblocked will begin using these resources to answer your team’s questions.

## Additional Guides

### Enabling Key Creation

If you see following error when trying to create a new Service Account key, you will need to enable Service Account key creation for your workspace.

<img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-error-1.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=52e4d0e9ac886832870f32dd902a88cb" alt="Connect-Google-Drive" width="1960" height="1280" data-path="img/g-workspace-error-1.png" />

To enable Service Account key creation, navigate to the **Organizational Policies** of your Google Cloud Console (this can be found in the left menu).

In the search filter, enter `iam.disableServiceAccountKeyCreation` to search for the "Disable service account key creation" policy. Click the context menu of the policy row and select **Edit Policy**.

<img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-error-2.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=45a413c336b4c17cda5461d6f2ca23ee" alt="Connect-Google-Drive" width="2760" height="1118" data-path="img/g-workspace-error-2.png" />

On the Edit policy page, choose **Override parent's policy**, ensuring **Not enforce** is selected before clicking **Set policy**.

<img src="https://mintcdn.com/unblocked/GS-c8rr-FQWhrU4y/img/g-workspace-error-3.png?fit=max&auto=format&n=GS-c8rr-FQWhrU4y&q=85&s=72a097c7fc975078f5de17fe5bae9a47" alt="Connect-Google-Drive" width="1920" height="1232" data-path="img/g-workspace-error-3.png" />

After overriding this policy, you can return to the Service Accounts page to generate the key.

<Note>
  The policy override may take a few minutes to take effect before key
  generation is allowed.
</Note>

### Creating a Custom Admin Role

If you prefer to provide a non-Super Admin account to connect with Unblocked, you can create a custom admin role and assign the role to the account you wish to use instead.

Navigate to [https://admin.google.com/ac/roles](https://admin.google.com/ac/roles) and create a new role with the following privileges enabled:

* Admin Console Privileges > Organizational Units > Read
* Admin Console Privileges > Users > Read
* Admin API Privileges > Groups > Read
* Admin API Privileges > Organizational Units > Read
* Admin API Privileges > Users > Read

Assign this new role to the preferred account and enter the email into the Super Admin Email field in Unblocked.

<Note>
  The assignment of the new role may take a few minutes to take effect.
</Note>
