This section walks through setting up the Google Drive connector using a Service Account. More info on Service Accounts can be found here. A Google Workspace is required.
If you’d rather use an individuals account + OAuth to access Google Drive, checkout the section here.
Create a Google Cloud Project
Enable the Google Drive API
- On the left panel, open APIs & services
- Go to Enabled APIs and services
- On the top click +ENABLE APIS AND SERVICES
- Search for Google Drive API and click ENABLE
- Alternatively visit this link, select your project and enable the Google Drive API
- Create a Service Account
- Go to the Service Account management page in Google Cloud.
Create Service Accountbutton and fill out the fields in step 1. You can ignore steps 2 and 3.
- Go to the
Keyssection, and click
Add Key. Download this key, you will need to upload to to Danswer later.
- Give this Service Account read-only access to Google Drive
- Copy the
Unique IDof the Service Account
- Go to the Domain-wide Delegation page in the Google Admin Console.
Add new, fill in the client ID with the
Unique IDof the Service Account, and add the
- Copy the
- Navigate to the Admin Dashboard and select the Google Drive Connector.
- Select the Service Account Key JSON that you downloaded in step (3), then click the Upload button to save your credentials into Danswer.
- Optionally select a user to “impersonate” when fetching files.
- If a user email is provided, then Danswer will have access to all documents that user has access to.
- If no user email is provided, then Danswer will have access to all documents that the Service Account you created in step (3) has access to. By default, this is no documents. You will have to share the relevant drives / shared drives with the Service Account so that it can pull documents.
- Click the
Connectbutton (optionally specifying specific paths that you want to index)! All documents accessible by the account specified in the previous step will now be pulled into Danswer every 10 minutes.