Home » n8n» How to connect SharePoint to n8n — Beginner Docker Guide

How to connect SharePoint to n8n?

How to connect SharePoint to n8n is answered here with a clear, short process. You can connect SharePoint to n8n by registering an Azure AD app for OAuth2, granting Sites permissions, and adding those credentials in n8n. After that you can use the Microsoft SharePoint node or the HTTP Request node to call SharePoint Online via Microsoft Graph or the SharePoint REST API.

How to connect SharePoint to n8n — What You Need

Prepare these items before you start. Keep each line short and clear.

  • An n8n instance running in Docker on a reachable URL (for OAuth callbacks).
  • An Azure AD tenant with permission to register apps or an admin to grant consent.
  • A SharePoint Online site in Microsoft 365.
  • n8n access to create credentials and flows.

How to Install and Run n8n in Docker

Start n8n with Docker Compose. Use a basic compose file below.

version: '3'
services:
  n8n:
    image: n8nio/n8n:latest
    ports:
      - "5678:5678"
    environment:
      - N8N_HOST=localhost
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
    restart: unless-stopped

Run the compose file:

docker-compose up -d

Step 1: Register an Azure AD App

Register an app in the Azure portal. This gives you client ID, client secret, and tenant ID.

  • Go to Azure Active Directory > App registrations > New registration.
  • Set Redirect URI to: http://localhost:5678/rest/oauth2-credential/callback (adjust if you use a different host or HTTPS).
  • Note the Application (client) ID and Directory (tenant) ID.
  • Create a client secret and copy it now. You will not see it again.

Step 2: API Permissions

Grant the app the least privilege needed. For interactive flows use delegated permissions. For server-to-server use application permissions.

  • For full site access via Graph: add Sites.ReadWrite.All.
  • After adding, click Grant admin consent.

Step 3: Test getting a token with curl (Client Credentials)

Use this command to verify tokens. Replace placeholders with values from Azure.

export TENANT_ID="your-tenant-id"
export CLIENT_ID="your-client-id"
export CLIENT_SECRET="your-client-secret"

curl -X POST \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "client_id=$CLIENT_ID&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret=$CLIENT_SECRET&grant_type=client_credentials" \
  "https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token"

The command returns a JSON with access_token. Save it for tests.

Step 4: Call Microsoft Graph to list site lists

Replace SITE_ID with your site id or use the site path. Use the token from the previous step.

export TOKEN="your-access-token"

curl -H "Authorization: Bearer $TOKEN" \
  "https://graph.microsoft.com/v1.0/sites/{site-id}/lists"

How to configure n8n credentials and nodes

Open n8n in your browser at http://localhost:5678. Create new credentials for Microsoft SharePoint or an OAuth2 API credential yourself.

  • Choose the Microsoft SharePoint credential type if present.
  • Enter Client ID, Client Secret, and Tenant ID from Azure.
  • Set Authorization URL: https://login.microsoftonline.com/{{TENANT}}/oauth2/v2.0/authorize
  • Set Token URL: https://login.microsoftonline.com/{{TENANT}}/oauth2/v2.0/token
  • Use the redirect URI you registered earlier.
  • Authenticate and allow consent when prompted.

After the credential is active, add a Microsoft SharePoint node or HTTP Request node in a workflow. Select your credential and call the Graph endpoints like /sites/{site-id}/lists.

Step 5: Example n8n HTTP Request node settings

Use Bearer auth if you manually store a token. Better use the OAuth2 credential so n8n refreshes tokens automatically.

Method: GET
URL: https://graph.microsoft.com/v1.0/sites/{site-id}/lists
Authentication: OAuth2 (select your SharePoint credential)

Update

Keep n8n and the n8n image updated. Pull the latest image and restart the container regularly.

docker pull n8nio/n8n:latest
docker-compose down && docker-compose up -d

Security

Follow basic security practices.

  • Do not store client secrets in code or public repos.
  • Use environment variables for secrets in Docker Compose.
  • Grant only the permissions you need in Azure AD. Use least privilege.
  • Use HTTPS for your public n8n URL and OAuth callback URL.
  • Rotate client secrets periodically and revoke unused apps.

Done

You now have a working path to connect SharePoint to n8n. Register the app, configure credentials in n8n, and use the Microsoft SharePoint or HTTP Request node to automate tasks. Test with the curl examples then build flows in n8n.


Neil
Written by Neil

Neil is a true n8n geek who lives and breathes workflow automation. He dives deep into nodes, triggers, webhooks, custom logic, and self-hosting setups, sharing everything he learns about n8n on AutomationCompare.com. As part of a broader team of automation specialists, Neil focuses purely on mastering n8n and helping others unlock its full potential.

Keep Reading

Scroll to Top