Skip to main content
Version: Latest

Microsoft OneDrive (identos.ms-onedrive)

User-delegated proxy for the Microsoft Graph OneDrive (Files) API. Every call runs as the signed-in user, so OneDrive's per-user permissions apply naturally. Two upstream-auth modes are supported:

  • entra_refresh (default) — PolicyArc uses the refresh token captured at the user's Microsoft sign-in to mint a fresh, correctly-audienced token per Microsoft service at call time. One sign-in works across any combination of Microsoft connectors — Graph (Mail, OneDrive, Teams) and Azure DevOps together. The minted token is cached per (user, resource) and re-minted on expiry; every call is made as the signed-in user.
  • idp_passthrough — forwards the user's Microsoft sign-in token directly to Graph, with no exchange. That sign-in token carries a single audience, so passthrough works for only one Microsoft resource — either Graph (Mail/OneDrive/Teams) or Azure DevOps, not both; don't mix passthrough across Graph and Azure DevOps. Choose this only for strict tenants that disable refresh-token issuance (no offline_access), or that don't want a long-lived refresh token warehoused by PolicyArc. Otherwise prefer entra_refresh.

When to use it

  • An agent or workflow needs to list, read, or download files in the caller's OneDrive, including items shared with them.
  • An agent needs to create, upload, update, copy, or delete files in the caller's own drive.
  • An agent needs to share items (sharing links, permission grants, invitations), gated by operator policy on external/anonymous sharing.

What it does NOT do

  • No service-account / domain-wide delegation. Access is always the signed-in user's; there is no shared service account.
  • No writes to other users' drives. Every route addresses the caller's own drive (/me/drive/...). Files.Read.All is requested only so that items shared with the caller can be read; the connector deliberately does not hold Files.ReadWrite.All.

Tool surface (17 tools)

Read paths use the onedrive:read scope; mutations use onedrive:write; sharing operations use onedrive:share. The autogenerated reference below this README has the full list with route patterns and input schemas.

Operator data

KeyEffect
protected_foldersFolders that may not be modified or deleted.
allow_anonymous_sharingWhen false, anonymous sharing links are denied.
allow_external_sharingWhen false, sharing with external users is denied.
allowed_domainsIf set, restricts sharing invitations to these domains.

(Policy rules ship in the connector's Rego package; connector-owned packages are loaded into OPA. Behaviour matches the gateway's connector-policy aggregation.)

Prerequisites

  • One PolicyArc Microsoft IdP (provider key microsoft) configured with the app's client_id/client_secret and the tenant authorize/token endpoints. For the default entra_refresh mode, the login scopes must include offline_access so a refresh token is captured; idp_passthrough does not need it. This is the same IdP Azure DevOps uses — shared, not per-connector. See the Entra ID IdP guide.
  • The Entra app granted these delegated Microsoft Graph permissions with admin consent: Files.Read, Files.ReadWrite, Files.Read.All.
  • PBAC_GATEWAY_CREDENTIAL_KEY set on the AS (encrypts the cached tokens).

Install

The connector supports two upstream-auth modes, selected at install time:

  • entra_refresh (default) — the gateway uses the refresh token from the user's Microsoft sign-in to mint a Graph-audienced token per call. Works alongside other Microsoft connectors (Mail, Teams, Azure DevOps) with a single sign-in.
  • idp_passthrough — the user's sign-in token is forwarded to Graph directly. Only works for Graph alone — don't mix it with an Azure DevOps passthrough connector. Reach for this only if your tenant disables refresh-token issuance or you don't want PolicyArc holding a long-lived refresh token; otherwise prefer entra_refresh.

Install from the admin UI (Resources → Add → Microsoft OneDrive), choose your auth mode, and click Install. The gateway resolves credentials from the Microsoft IdP registration.

Troubleshooting

  • 502 "admin consent / API permission missing" — the Entra app is missing one of the Graph permissions above, or admin consent was not granted.
  • 401 from Graph — the refresh token is expired or offline_access was not in the login scopes; re-authenticate through the Entra IdP.

Manifest reference

  • ID: identos.ms-onedrive
  • Version: 1.0.0
  • Resource type: urn:connector:identos:ms-onedrive
  • Capabilities: mcp

Supported auth modes

TypeDetails
entra_refreshrequires IdP microsoft
idp_passthroughrequires IdP microsoft

Setup fields

IDLabelDefaultSecret?Notes
upstream_auth.typeAuthenticationentra_refreshnoAuthentication mode. entra_refresh (default) mints a separate per-resource token for each Microsoft service from your one sign-in, so a single login works across any mix of Microsoft connectors — Graph (Mail/OneDrive/Teams) and Azure DevOps together. idp_passthrough instead forwards your Microsoft sign-in token as-is, and that token is valid for only one audience: passthrough therefore works for either Graph (Mail/OneDrive/Teams) or Azure DevOps, not both. Use entra_refresh if you need more than one.

Scopes

Scope
onedrive:read
onedrive:write
onedrive:share
onedrive:admin

Routes

MethodPatternScopeResource template
GET/v1.0/me/driveonedrive:read
GET/v1.0/me/drive/root/childrenonedrive:read
GET/v1.0/me/drive/items/{item_id}/childrenonedrive:readonedrive://{item_id}/children
GET/v1.0/me/drive/items/{item_id}onedrive:readonedrive://{item_id}
GET/v1.0/me/drive/root:/{path}onedrive:readonedrive://root:/{path}
GET/v1.0/me/drive/items/{item_id}/contentonedrive:readonedrive://{item_id}/content
GET/v1.0/me/drive/recentonedrive:read
GET/v1.0/me/drive/sharedWithMeonedrive:read
GET/v1.0/me/drive/root/searchonedrive:read
POST/v1.0/me/drive/items/{parent_id}/childrenonedrive:writeonedrive://{parent_id}/children
PUT/v1.0/me/drive/items/{parent_id}:/{filename}:/contentonedrive:writeonedrive://{parent_id}/{filename}
PATCH/v1.0/me/drive/items/{item_id}onedrive:writeonedrive://{item_id}
DELETE/v1.0/me/drive/items/{item_id}onedrive:writeonedrive://{item_id}
POST/v1.0/me/drive/items/{item_id}/copyonedrive:writeonedrive://{item_id}/copy
GET/v1.0/me/drive/items/{item_id}/permissionsonedrive:shareonedrive://{item_id}/permissions
POST/v1.0/me/drive/items/{item_id}/createLinkonedrive:shareonedrive://{item_id}/links
POST/v1.0/me/drive/items/{item_id}/inviteonedrive:shareonedrive://{item_id}/invites

MCP tools

NameScopeDescription
get_driveonedrive:readGet the signed-in user's default OneDrive drive metadata (quota, owner, drive type).
list_drive_rootonedrive:readList all files and folders at the root of the signed-in user's OneDrive.
list_folder_childrenonedrive:readList the contents of a specific folder in OneDrive by its item ID.
get_drive_itemonedrive:readGet metadata for a specific file or folder in OneDrive by its item ID.
get_drive_item_by_pathonedrive:readGet metadata for a file or folder by its path relative to the OneDrive root, e.g. "Documents/Report.docx".
download_fileonedrive:readGet a short-lived pre-authenticated URL for downloading a file's binary content from OneDrive. Returns {download_url: "..."} — fetch that URL with a plain HTTP GET (no auth header) to retrieve the bytes. The URL is bound to the caller's identity and expires after ~15 minutes. Do not log or persist it.
list_recent_filesonedrive:readList files the signed-in user has recently accessed in OneDrive.
list_shared_with_meonedrive:readList files and folders that others have shared with the signed-in user.
search_driveonedrive:readSearch for files and folders in the signed-in user's OneDrive by name or content.
create_folderonedrive:writeCreate a new folder inside a parent folder in OneDrive.
upload_fileonedrive:writeUpload or replace a file in OneDrive. Use for files up to 4 MB; use resumable upload for larger files.
update_drive_itemonedrive:writeUpdate a file or folder's metadata — rename it, move it to a different parent, or update other properties.
delete_drive_itemonedrive:writeDelete a file or folder from OneDrive. Deleted items go to the recycle bin.
copy_drive_itemonedrive:writeCopy a file or folder to a new location in OneDrive. Graph processes the copy asynchronously and returns {monitor_url: "..."} — poll that URL to track progress.
list_item_permissionsonedrive:shareList all sharing permissions on a file or folder, including links and direct grants.
create_sharing_linkonedrive:shareCreate a sharing link for a file or folder. Supports view-only and edit links scoped to the organisation or anonymous.
invite_users_to_itemonedrive:shareShare a file or folder directly with specific users by email address.

Operator data schema

Keys the operator can supply under data.pbac.operator.connectors["identos.ms-onedrive"].* — consumed by the connector's policy.

KeyTypeDescription
protected_foldersarrayFolder name segments (case-insensitive) that are blocked for all access. Path-based routes whose path begins with a matching segment are denied. Example: ["HR", "Legal", "Executive"].
allow_anonymous_sharingbooleanWhen false (default), creating sharing links with scope "anonymous" (public links) is blocked.
allow_external_sharingbooleanWhen false (default), inviting users outside the organisation (external email domains) is blocked. Requires the operator to also seed allowed_domains.
allowed_domainsarrayEmail domains considered internal. Used by the external-sharing block rule. Example: ["identos.ca", "contoso.com"]. Required when allow_external_sharing is false.