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 (nooffline_access), or that don't want a long-lived refresh token warehoused by PolicyArc. Otherwise preferentra_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) under the
onedrive:sharescope.
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.Allis requested only so that items shared with the caller can be read; the connector deliberately does not holdFiles.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
protected_folders is the only operator key the connector's Rego reads.
Earlier versions of this README listed allow_anonymous_sharing,
allow_external_sharing and allowed_domains. No rule reads them, so
setting them has no effect.
The Rego has two deny rules, and neither fires today. One is meant to block
paths under the folders in protected_folders; the other is meant to block
file names that look like secrets (.env, .key, .pem, or a secrets/
folder). Both compare input.resource.id with the prefix onedrive://root:/.
input.resource.id is the id of the resource the token holds, not the called
item, and it was null in our run. The path is not in
input.context.rs_context.resource_id either. The route's template
onedrive://root:/{path} uses single braces, so the gateway sets no resource
id for it (ConnectorV1Adapter.java), and resource_id was null over REST and
MCP. The path reaches policy only as tool_arguments.path. On a local instance with
protected_folders set to ["HR"], get_drive_item_by_path returned the
item for HR and for prod.env, over REST and over MCP.
Prerequisites
- One PolicyArc Microsoft IdP (provider key
microsoft) configured with the app'sclient_id/client_secretand the tenant authorize/token endpoints. For the defaultentra_refreshmode, the login scopes must includeoffline_accessso a refresh token is captured;idp_passthroughdoes 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_CREDENTIAL_KEY(or the legacyPBAC_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 preferentra_refresh.
Install from the Admin Portal (APIs & Connectors → + Connect a resource → Microsoft OneDrive), choose your auth mode, and select Connect. 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 with
"error": "idp_link_required"— the gateway, not Graph, answers this when the user has no storedmicrosofttoken or the stored refresh token is expired or revoked. Open thelink_urlfrom the response body and sign in through the Entra IdP. If no link can be built, the gateway answers502with "refresh token expired or revoked; user must re-authenticate" instead. - 502 "entra_refresh: no stored refresh token ... must authenticate with
offline_access" — the user signed in without
offline_access, so no refresh token was stored. In our run the gateway answered this502, with nolink_url, while the user's stored access token was still valid. The login scopes must includeoffline_access(see the prerequisites above).
Manifest reference
- ID:
identos.ms-onedrive - Version:
1.2.0 - Resource type:
urn:connector:identos:ms-onedrive - Capabilities:
mcp
Supported auth modes
| Type | Details |
|---|---|
entra_refresh | requires IdP microsoft |
idp_passthrough | requires IdP microsoft |
Setup fields
| ID | Label | Default | Secret? | Notes |
|---|---|---|---|---|
upstream_auth.type | Authentication | entra_refresh | no | Authentication 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
| Method | Pattern | Scope | Resource template |
|---|---|---|---|
GET | /v1.0/me/drive | onedrive:read | — |
GET | /v1.0/me/drive/root/children | onedrive:read | — |
GET | /v1.0/me/drive/items/{item_id}/children | onedrive:read | onedrive://{item_id}/children |
GET | /v1.0/me/drive/items/{item_id} | onedrive:read | onedrive://{item_id} |
GET | /v1.0/me/drive/root:/{path} | onedrive:read | onedrive://root:/{path} |
GET | /v1.0/me/drive/items/{item_id}/content | onedrive:read | onedrive://{item_id}/content |
GET | /v1.0/me/drive/recent | onedrive:read | — |
GET | /v1.0/me/drive/sharedWithMe | onedrive:read | — |
GET | /v1.0/me/drive/root/search | onedrive:read | — |
POST | /v1.0/me/drive/items/{parent_id}/children | onedrive:write | onedrive://{parent_id}/children |
PUT | /v1.0/me/drive/items/{parent_id}:/{filename}:/content | onedrive:write | onedrive://{parent_id}/{filename} |
PATCH | /v1.0/me/drive/items/{item_id} | onedrive:write | onedrive://{item_id} |
DELETE | /v1.0/me/drive/items/{item_id} | onedrive:write | onedrive://{item_id} |
POST | /v1.0/me/drive/items/{item_id}/copy | onedrive:write | onedrive://{item_id}/copy |
GET | /v1.0/me/drive/items/{item_id}/permissions | onedrive:share | onedrive://{item_id}/permissions |
POST | /v1.0/me/drive/items/{item_id}/createLink | onedrive:share | onedrive://{item_id}/links |
POST | /v1.0/me/drive/items/{item_id}/invite | onedrive:share | onedrive://{item_id}/invites |
MCP tools
| Name | Scope | Description |
|---|---|---|
get_drive | onedrive:read | Get the signed-in user's default OneDrive drive metadata (quota, owner, drive type). |
list_drive_root | onedrive:read | List all files and folders at the root of the signed-in user's OneDrive. |
list_folder_children | onedrive:read | List the contents of a specific folder in OneDrive by its item ID. |
get_drive_item | onedrive:read | Get metadata for a specific file or folder in OneDrive by its item ID. |
get_drive_item_by_path | onedrive:read | Get metadata for a file or folder by its path relative to the OneDrive root, e.g. "Documents/Report.docx". |
download_file | onedrive:read | Get 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_files | onedrive:read | List files the signed-in user has recently accessed in OneDrive. |
list_shared_with_me | onedrive:read | List files and folders that others have shared with the signed-in user. |
search_drive | onedrive:read | Search for files and folders in the signed-in user's OneDrive by name or content. |
create_folder | onedrive:write | Create a new folder inside a parent folder in OneDrive. |
upload_file | onedrive:write | Upload or replace a file in OneDrive. Pass text in content, or binary as file_content_base64 — exactly one of the two. Very large files are not supported. |
update_drive_item | onedrive:write | Update a file or folder's metadata — rename it, move it to a different parent, or update other properties. |
delete_drive_item | onedrive:write | Delete a file or folder from OneDrive. Deleted items go to the recycle bin. |
copy_drive_item | onedrive:write | Copy 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_permissions | onedrive:share | List all sharing permissions on a file or folder, including links and direct grants. |
create_sharing_link | onedrive:share | Create a sharing link for a file or folder. Supports view-only and edit links scoped to the organisation or anonymous. |
invite_users_to_item | onedrive:share | Share 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.
| Key | Type | Description |
|---|---|---|
protected_folders | array | Folder 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"]. |
Send feedback about this page