- Admins to search and select labels in Field Controls conditional rules
- Agents and administrators to use the Google Drive MCP server’s
list_labelsandlist_file_labelstools
Prerequisites
You need:- Admin access to your Barndoor organization
- A Google Workspace edition that supports Drive labels
- Permission to create an OAuth client and enable APIs in a Google Cloud project
- At least one published, Drive-enabled label in your Google Workspace
- A Google Workspace user who can view the labels you want Barndoor to discover
1. Prepare your Google Drive labels
Barndoor discovers existing labels; it does not create or publish the label taxonomy.- Open Label manager in the Google Admin console, or navigate to Security → Access and data control → Label manager. You need the Manage Classification Labels privilege.
- On Classification labels, create the labels your organization needs.
- Enable the labels for Drive and publish them. Published Drive-enabled labels show Drive under Applications and Published under Status.
If you lack that privilege, Google may send you to
/permissiondenied or a
redirect-loop error. That is an authorization failure, not a broken link.Before continuing, confirm that at least one label is published and enabled for
Drive in Label manager.
2. Configure a Google Cloud project
Use the same Google Cloud project for the OAuth client and both required APIs.- Create or select a project in Google Cloud.
- Enable the Drive Labels API.
- Enable the Google Drive API.
- Open Google Auth Platform and configure the app’s branding and audience. If the app is in Testing, add the identities that will connect to Barndoor as test users.
- Create an OAuth client with application type Web application.
-
Add the production redirect URI from
Redirect URI Allowlisting:
If you are connecting from a Barndoor trial hostname, allowlist that hostname’s
/callbackURI as well. A mismatch is a Google redirect error, not a Barndoor scope error. -
On Google Auth Platform → Data Access, add every scope Barndoor will
request. A new private client needs the default Google Drive scopes plus
Labels:
Adding a scope on Data Access only makes it available to request. Barndoor must also list it on the server instance, then the user must reconnect.
The Drive Labels API provides the label taxonomy. The Google Drive API
provides file search and file-label access. Enabling the separate Drive MCP
API does not enable these tools.
Before continuing, confirm that both APIs show as enabled, the Web application
OAuth client has
https://app.barndoor.ai/callback (and any trial callback
you use), and Data Access lists the default Drive scopes plus
drive.labels.readonly.3. Configure Google Drive in Barndoor
In this guide, service account means the organization-level OAuth connection
on the Barndoor server detail page. It does not mean a Google Cloud IAM service
account. Connect a Google Workspace user that can view the labels you need.
- Navigate to Admin → MCP Servers.
- Add Google Drive from the Barndoor-managed MCP server directory, or open an existing Google Drive server.
- Turn off Use stored public OAuth credentials.
- Paste the Client ID and Client Secret from your Google Cloud OAuth client. On an existing server, those fields are New Client ID and New Client Secret. Leave them blank to keep the current credentials.
-
In Scopes, keep the default Drive scopes and add:
drive.labels.readonlyis the least-privilege scope for Field Controls discovery (list_labels/list_file_labels). The broaderdrive.labelsscope is only for applying an existing label to a file (update_file_labels). It does not create or publish the taxonomy — there is nocreate_labeltool — and it still cannot classify a file this OAuth app did not create. That write fails withappNotAuthorizedToFilebecause the defaultdrive.filescope cannot stamp existing Docs. - Save the server configuration. Do not select Reset to default scopes afterward, because that removes the Labels scope.
- On the server detail page, connect the service account that Field Controls will use for live label discovery.
The service account connection should show as connected, and the completed
Google consent flow should include access to Drive labels.
4. Search and select labels in Field Controls
- Navigate to Data Control Center → Field Controls.
- Click Add Conditional Rule.
- Select the configured Google Drive server.
- Under When, select Provider classification.
- Use Search Drive labels to find a published label, then select it.
- Configure the rule’s direction and action, then click Add Rule.
Your organization’s published labels should appear under the live results when
you search Provider classification.
Verify the setup
You can verify label discovery in either place:- In Field Controls, Provider classification shows your published label titles under the live results.
- Through the Google Drive MCP server, the
list_labelstool returns the published label taxonomy.
list_file_labels with that file’s ID.
Troubleshooting
list_labels returns a 403 for drivelabels.googleapis.com
list_labels returns a 403 for drivelabels.googleapis.com
Enable the Drive Labels API on the Google Cloud project that owns the
OAuth client. Wait a few minutes, then retry.
File search returns a 403 saying the Drive API is disabled
File search returns a 403 saying the Drive API is disabled
Enable the Google Drive API on the same project, wait a few minutes, and
retry.
The Google consent screen omits Labels or Drive file scopes
The Google consent screen omits Labels or Drive file scopes
Confirm that:
- Use stored public OAuth credentials is off
- The private Client ID and Client Secret are saved on the server
- Data Access on the Google OAuth client lists every scope Barndoor
will request, including the default Drive scopes and
drive.labels.readonly - The same scopes are present on the server’s Scopes field
Label manager shows permission denied or a redirect loop
Label manager shows permission denied or a redirect loop
You are not authorized for Label
manager. Ask a Google Workspace
super admin to grant Manage Classification Labels, then retry. The
URL is correct even when Google redirects to
/permissiondenied.No error appears, but the live label list is empty
No error appears, but the live label list is empty
Confirm that the labels are published, enabled for Drive, and visible to the
Google Workspace user connected through Barndoor’s organization-level
service account connection. An empty list usually means the API and OAuth
grant are working but that user cannot see any eligible labels.
Limitations
- Barndoor discovers existing labels but does not create or publish the label
taxonomy. There is no
create_labeltool on the Google Drive connector. - Reading labels on an existing file works. Applying them often does not:
update_file_labelsreturnsappNotAuthorizedToFilefor files this OAuth app did not create, even if you requesteddrive.labelsinstead ofdrive.labels.readonly. The defaultdrive.filescope cannot stamp the customer’s existing corpus. - Organizations that do not need Drive label discovery should continue using Barndoor’s stored public OAuth credentials.