Google Drive OAuth
Set up Google Drive OAuth for the connector
Availability depends on your school's enabled tools, provider setup, and account permissions. These settings are managed in the web workspace. A class policy may restrict a feature described here.
This section walks through setting up the Google Drive connector using a OAuth-enabled Google App. Anyone can do this (even without a paid Google Workspace)!
If you're an organization with a Google Workspace, and you'd rather use a Service Account to access Google Drive, checkout the section here.
Authorization#
Create Google Cloud Project#
Enable 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
Enable Admin SDK API#
Click on +ENABLE APIS AND SERVICES again.
Search for Admin SDK API and click ENABLE
Alternatively visit this link, select your project and enable the Admin SDK API
Enable Google Sheets API#
Click on +ENABLE APIS AND SERVICES again.
Search for Google Sheets API and click ENABLE
Alternatively visit this link, select your project and enable the Google Sheets API
Enable Google Docs API#
Click on +ENABLE APIS AND SERVICES again.
Search for Google Docs API and click ENABLE
Alternatively visit this link, select your project and enable the Google Docs API
Set up OAuth consent screen#
Under APIs & services, select the OAuth consent screen tab
If you don't have a Google Organization select External for User Type
Call the app Nexus (or whatever you want)
For the required emails, use any email of your choice or
founders@onyx.appif you wish for the Nexus team to help handle issues.Click SAVE AND CONTINUE
Set up scopes#
Add the scope
.../auth/drive.readonlyforGoogle Drive APIAdd the scope
.../auth/drive.metadata.readonlyforGoogle Drive APIAdd the scope
.../auth/admin.directory.user.readonlyforAdmin SDK APIAdd the scope
.../auth/admin.directory.group.readonlyforAdmin SDK API
Set up test users#
This is only applicable for users without a Google Organization.
Typically for a company, Nexus would be set up as an internal app so this step would not apply.
Add at least one test user email. Only the email accounts added here will be allowed to run the OAuth flow to index new documents.
Click SAVE AND CONTINUE, review the changes and click BACK TO DASHBOARD
Create credentials#
Go to the Credentials tab and select + CREATE CREDENTIALS -> OAuth client ID
Choose Web application and give it some name like
NexusConnectorAdd a Authorized JavaScript origins
http://localhost:3000if self-hostinghttps://<INTERNAL_DEPLOYMENT_URL>if you have setup Nexus for production usehttps://school.narb.ccwhen configuring the school workspaceAdd a Authorized redirect URIs
http://localhost:3000/admin/connectors/google-drive/auth/callbackif self-hostinghttps://<INTERNAL_DEPLOYMENT_URL>/admin/connectors/google-drive/auth/callbackif you have setup Nexus for production usehttps://school.narb.cc/admin/connectors/google-drive/auth/callbackwhen configuring the school workspaceClick create and on the right hand side next to Client secret, there is an option to download the credentials as a JSON. Download the JSON for use in the next step.
Indexing#
First, navigate to the Admin Panel and select the Google Drive connector.
Then, click Create New. Under Option 1: OAuth app, upload (or paste) the OAuth app JSON you downloaded in the final step above, then click Authenticate with Google Drive and continue with the account you want to use to index Google Drive.
Once complete, select the newly created credential, and click the Continue button to configure the connector!
The app JSON is stored on the credential it creates, so each OAuth credential carries its own app. To add more connectors for the same account, select the existing credential from the list instead of creating a new one. An instance can hold multiple Google Drive credentials, including ones using different OAuth apps or different Google Workspaces.
If you plan on using permission syncing for this connector, the account performing the OAuth flow must have an Admin role in the Google Workspace that has access to the following:
Admin console privileges -> Services -> Drive and Docs -> Settings
Admin API privileges -> Users -> Read
Admin API privileges -> Groups -> Read
Admin API privileges -> Organization Units -> Read
This can be set by an admin in the admin panel of the Google Workspace under Account > Admin roles.
Before using this source with students#
Start with approved course material. Check which documents the connector can retrieve and how it maps source permissions. Test with a student account and a teacher account before widening access. A successful sync does not prove that the intended class boundary is correct.
Use source troubleshooting when a document is missing or visible to the wrong audience.