n8n-nodes-sharepoint-custom
v0.1.9
Published
n8n nodes for Microsoft services with OAuth2 authentication - forked from n8n-io/n8n
Maintainers
Readme
n8n-nodes-sharepoint-custom
This is an n8n community node that provides Microsoft OAuth2 authentication using Client Credentials grant type. This credential type is designed for server-to-server authentication scenarios and does not require a callback URL, making it ideal for Microsoft services like SharePoint, OneDrive, Outlook, and other Microsoft Graph API services.
Key Features
- Client Credentials Flow: Uses the OAuth2 client credentials grant type (
grant_type=client_credentials) - No Callback URL Required: Perfect for server-to-server authentication scenarios
- Tenant-Specific Authentication: Supports organization-specific Azure AD tenants
- Microsoft Services Compatible: Works with SharePoint, OneDrive, Outlook, Microsoft Graph, and other Microsoft services
Installation
To use this credential in your n8n instance:
- Install via npm:
npm install n8n-nodes-sharepoint-custom- Or install directly in your n8n installation:
cd ~/.n8n/nodes
npm install n8n-nodes-sharepoint-custom- Restart n8n
Configuration
Prerequisites
Before configuring this credential, you need to:
- Register an application in Azure AD (Azure Active Directory)
- Configure API permissions for the Microsoft services you want to use
- Create a client secret
- Note your tenant ID
Credential Setup
In n8n, go to Credentials → New
Search for and select Microsoft OAuth2 API (Client Credentials)
Fill in the required fields:
Access Token URL:
https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token- Replace
{tenant}with your Azure AD tenant ID or domain name - For single-tenant apps: Use your specific tenant ID (e.g.,
12345678-1234-1234-1234-123456789abc) - For multi-tenant apps: Use
organizations,common, orconsumers - Example:
https://login.microsoftonline.com/12345678-1234-1234-1234-123456789abc/oauth2/v2.0/token
- Replace
Client ID: Your application (client) ID from Azure AD
Client Secret: Your application's client secret from Azure AD
Scope: The API scope you want to access
- For Microsoft Graph:
https://graph.microsoft.com/.default - For SharePoint:
https://{tenant}.sharepoint.com/.default - For specific permissions: Specify the exact scope (e.g.,
https://graph.microsoft.com/Sites.Read.All)
- For Microsoft Graph:
Example Scopes
- Microsoft Graph (all permissions):
https://graph.microsoft.com/.default - SharePoint:
https://{yourtenant}.sharepoint.com/.default - OneDrive:
https://graph.microsoft.com/.default(with Files.Read.All permission) - Outlook/Exchange:
https://outlook.office365.com/.default
Azure AD App Registration
To set up the Azure AD application:
- Go to Azure Portal
- Navigate to Azure Active Directory → App registrations → New registration
- Configure the application:
- Name: Choose a descriptive name (e.g., "n8n Integration")
- Supported account types: Choose based on your needs
- No redirect URI is required for client credentials flow
- After creation, note the Application (client) ID and Directory (tenant) ID
- Go to Certificates & secrets → New client secret
- Create a secret and copy its value immediately (it won't be shown again)
- Go to API permissions → Add a permission
- Select the Microsoft service (e.g., Microsoft Graph)
- Choose Application permissions (not Delegated)
- Add the required permissions (e.g., Sites.Read.All, Files.Read.All)
- Click Grant admin consent for your organization
Differences from Standard Microsoft OAuth2
This credential differs from the standard microsoftOAuth2Api in n8n:
| Feature | Standard (Authorization Code) | This Package (Client Credentials) |
|---------|------------------------------|-----------------------------------|
| Grant Type | authorization_code | client_credentials |
| Callback URL | Required | Not required |
| User Context | Yes (acts on behalf of a user) | No (acts as the application) |
| Interactive Login | Required | Not required |
| Use Case | User-delegated operations | Server-to-server operations |
| Permissions | Delegated permissions | Application permissions |
Use Cases
This credential is ideal for:
- Automated Data Sync: Scheduled workflows that sync data from SharePoint, OneDrive, etc.
- Background Processing: Server-side operations without user interaction
- Bulk Operations: Processing large amounts of data across Microsoft services
- Service Integration: Integration between n8n and Microsoft services in production environments
- Webhook Handlers: Processing Microsoft webhook events without user authentication
Development
To build this package:
npm install
npm run buildTo watch for changes during development:
npm run build:watchCompatibility
- n8n version: 0.100.0 or higher
- Node.js: 18.x or higher
Resources
- n8n Community Nodes Documentation
- Microsoft Identity Platform - Client Credentials Flow
- Microsoft Graph API Documentation
License
MIT
Support
For issues, questions, or contributions, please visit the GitHub repository.
