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.
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
| Key | Effect |
|---|
protected_folders | Folders that may not be modified or deleted. |
allow_anonymous_sharing | When false, anonymous sharing links are denied. |
allow_external_sharing | When false, sharing with external users is denied. |
allowed_domains | If 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
| 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 |
| 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. Use for files up to 4 MB; use resumable upload for larger files. |
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"]. |
allow_anonymous_sharing | boolean | When false (default), creating sharing links with scope "anonymous" (public links) is blocked. |
allow_external_sharing | boolean | When false (default), inviting users outside the organisation (external email domains) is blocked. Requires the operator to also seed allowed_domains. |
allowed_domains | array | Email domains considered internal. Used by the external-sharing block rule. Example: ["identos.ca", "contoso.com"]. Required when allow_external_sharing is false. |