Repository navigation
feat(onedrive): Each user signs in, and the rest of n8n's operations (1.0.0) - #4165
Open
ForeignKeyCN wants to merge 3 commits into
Open
ForeignKeyCN wants to merge 3 commits into
ForeignKeyCN wants to merge 3 commits into
Conversation
…r's own OneDrive (1.0.0)
…ext upload, matching n8n
This was referenced Nov 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two things, to bring OneDrive in line with Outlook (#4163) and Teams (#4164) and with n8n's Microsoft OneDrive node.
1. Each user signs in (new Mode on the API Key credential, next to Service Principal)
Today an OneDrive authorization is shared: everyone using the tool works on the OneDrive of the one person who signed in from the console (OAuth), or of a named user (Service Principal). For a chat agent that many people use ("save this to my OneDrive", "find my Q3 report"), each person should work on their own OneDrive.
GET /onedrive/callback) receives the browser's return and only stores the one-time code under its state; it never sees the client secret or the PKCE verifier.client_id | Dify user IDand Fernet-encrypted with a key derived (HKDF) from the client secret. Tokens never appear in tool output or logs; the user ID comes from Dify's runtime, never from the LLM. The tools then act on that user's/me/drive; the Drive Owner parameter is refused in this mode.User.Read Files.Read.All Files.ReadWrite.All offline_access(the OAuth credential's, plusUser.Readto name the signed-in account andoffline_accessexplicitly).onedrive_sign_out: the new Agent exposes tools by their bare name and rejects duplicates, so it cannot share a name with Outlook's or Teams' sign-out.2. n8n parity
n8n's node has file copy/delete/download/get/rename/search/share/upload and folder create/delete/get children/rename/search/share. The existing four tools covered get, download, delete, search and upload; this adds the rest:
onedrive_list_folder): items in a folder (root by default), up to 200, following Graph's paging links only on the Graph hostonedrive_create_folder): a name or a path such asReports/2026; missing folders are created, existing ones reused;..refusedonedrive_rename)onedrive_copy): same or another folder, optional new name; a taken name gets a number appended. OneDrive copies asynchronously: the tool polls the monitor URL for up to 15 s without the bearer token (it is pre-authenticated and on another host) and otherwise reportsin_progressonedrive_share): view / edit / embed, organization / anonymous; defaults to a view link for the organization, with a hint when the tenant refuses the link typeNew tool names carry an
onedrive_prefix for the same Agent name-uniqueness reason; the existing four keep their names so workflows do not break.Existing OAuth and Service Principal authorizations keep working unchanged; the version goes to 1.0.0, matching Outlook and Teams.
Release Notes
Change Type
Screenshots / Videos
Agent on a self-hosted Dify with Outlook, Teams and OneDrive, each using Each user signs in:
Testing
pytest): per-user sign-in (full flow, cached and refreshed tokens, per-user isolation and encryption at rest, secret rotation, revoked vs. temporarily failing refresh, callback state checks and the cancel link), per-user validation (secret check, localhost, wrong path), the new tools (paging and the foreign-host link guard, nested folder creation and reuse, a file in the way, rename validation, copy body / conflict behaviour / monitor polled without the token, share defaults and refused links, text upload into a folder), and every tool's output variables on success and on a Graph error.Checklist
manifest.yaml(0.1.1 → 1.0.0)