SharePoint / OneDrive
Erato provides support for Microsoft SharePoint and OneDrive integration, allowing users to attach files from their Microsoft cloud storage directly to chats.
Overview
When enabled, users can:
- Browse their OneDrive and SharePoint drives
- Search drive/site names and filenames across accessible libraries
- Keep selected files while changing searches or browsing other folders
- Attach files from SharePoint/OneDrive to chats
- Use SharePoint files with assistants
- Reference SharePoint files in messages for AI processing
The integration uses the Microsoft Graph API to access files. Users must authenticate with an identity provider that provides a valid Microsoft access token with the appropriate permissions.
Prerequisites
Before enabling the SharePoint integration, ensure:
- OIDC Provider: Your SSO/OIDC provider (e.g., Microsoft Entra ID / Azure AD) is configured to issue access tokens with Microsoft Graph API permissions
- Token Forwarding: Your authentication proxy (e.g., oauth2-proxy) forwards the access token to the backend via the
X-Forwarded-Access-Tokenheader - Graph API Permissions: Cross-drive filename search (enabled by default) requires delegated
Files.Read.AllorSites.Read.Allpermission for Microsoft Graph. For deployments with onlyFiles.Read, setfile_search_enabled = falseto retain drive/site search and browsing. Individual discovery sources may require additional permissions.
Configuration
To enable the SharePoint/OneDrive integration, add the following to your configuration:
[integrations.sharepoint]
enabled = trueConfiguration Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Whether the SharePoint integration is enabled |
file_search_enabled | boolean | true | Enable cross-drive filename search; false restores drive/site-only search |
file_upload_enabled | boolean | true | Whether file linking from SharePoint is enabled |
auth_via_access_token | boolean | true | Use the user’s forwarded access token for MS Graph API (currently required) |
show_disclaimer | boolean | false | Show a disclaimer about unexpectedly visible SharePoint/OneDrive directories in the picker |
all_drives_sources | string[] | [] | Optional subset of Graph discovery surfaces for /all-drives; empty means all |
Full Example
[integrations.sharepoint]
enabled = true
file_upload_enabled = true
file_search_enabled = true
auth_via_access_token = true
show_disclaimer = true
all_drives_sources = ["me_drive", "me_drives", "shared_with_me", "shared_drive_details"]Drive Discovery Sources
all_drives_sources controls which Microsoft Graph discovery surfaces Erato uses when listing accessible drives. Supported values are:
me_driveme_drivesjoined_teamsgroup_drivessite_searchsite_drivesshared_with_meshared_drive_details
If you do not set all_drives_sources, Erato queries the full set of sources to preserve the existing behavior. This can be useful for tenants where some discovery paths return very large numbers of drives or where only a subset of drive types should appear in browsing and drive-name search. This setting does not restrict the cross-drive filename search scope; Microsoft Graph applies the signed-in user’s access permissions.
File Search
With integrations.sharepoint.file_search_enabled = true (the default), the picker searches filenames across all indexed SharePoint and OneDrive files the signed-in user can access, including public libraries. It uses Microsoft Search (POST /v1.0/search/query) with a filename restriction, one request per result page instead of one search per drive. Drive/site-name search runs independently using all_drives_sources; it is not a prerequisite for finding files.
File results show their library, site, and folder path when metadata is available. Only libraries/sites represented in the bounded result set are looked up for display metadata. A failed metadata lookup does not prevent selecting the file. Selections persist across searches and navigation.
Search uses the signed-in user’s delegated Microsoft Graph access token; it does not grant additional access. Only filename matches are displayed. Microsoft’s indexed phrase/prefix matching does not guarantee arbitrary filename substring matches, and recently changed files may not appear immediately.
Search displays up to 100 files and reads at most ten global result pages. Graph work is bounded to 20 seconds overall, with shorter budgets for file queries and optional drive-name discovery. Successful file pages survive subsequent failures, and incomplete discovery does not block file results. The picker indicates when search limits are reached.
To disable filename search and restore the original drive/site-only search:
[integrations.sharepoint]
enabled = true
file_search_enabled = falseThis changes the picker field back to “Search drives…”, uses the existing /all-drives?query=... endpoint, and disables /integrations/sharepoint/search on the backend. Browsing and attaching files remain available. This is also the compatibility option for deployments without the Microsoft Search permissions listed above.
Authentication Flow
- User authenticates via your OIDC provider (e.g., Microsoft Entra ID)
- The OIDC provider issues an access token with MS Graph permissions
- oauth2-proxy (or similar) forwards the token via
X-Forwarded-Access-Tokenheader - Erato backend uses this token to call the Microsoft Graph API on behalf of the user
Limitations
- Token-based auth only: Currently requires the user’s access token to be forwarded; service account authentication is not yet supported
- Read-only: Files are referenced by ID; Erato does not upload files to SharePoint