How to Set Up Microsoft OAuth Credentials in n8n

3 min read 6 days ago
Published on Aug 31, 2025 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial will guide you through the process of setting up Microsoft OAuth credentials in n8n. By completing this setup, you will be able to connect your n8n workflows with various Microsoft services such as Outlook, Teams, and Excel Online. This integration enhances your automation capabilities, allowing for seamless interactions with Microsoft products.

Step 1: Create an Azure Account

To get started, you need to have an Azure account. Follow these steps to create one:

  1. Visit the Azure website.
  2. Click on "Start free" to create a free account.
  3. Follow the prompts to enter your details and complete the registration process.

Step 2: Register an Application in Azure

Once you have your Azure account set up, you need to register an application to obtain the necessary OAuth credentials.

  1. Navigate to the Azure Portal.
  2. Sign in with your Azure account credentials.
  3. In the Azure portal, select "Azure Active Directory" from the left sidebar.
  4. Click on "App registrations."
  5. Click the "New registration" button at the top.
  6. Fill in the application registration form:
    • Name: Enter a name for your application (e.g., n8n Integration).
    • Supported account types: Choose the appropriate option based on your needs (e.g., "Accounts in this organizational directory only").
    • Redirect URI: Set the type to "Web" and enter the URI for n8n (typically https://YOUR_N8N_INSTANCE/oauth/callback).
  7. Click "Register" to create the application.

Step 3: Configure API Permissions

After registering your application, you need to set up the required API permissions.

  1. In the application page, navigate to "API permissions" from the left sidebar.
  2. Click on "Add a permission."
  3. Select "Microsoft Graph."
  4. Choose "Delegated permissions" or "Application permissions" based on your requirements.
  5. Add the permissions you need (e.g., Mail.Read, User.Read, etc.).
  6. Click "Add permissions."

Step 4: Generate Client Secret

To connect n8n with your Microsoft application, you need to generate a client secret.

  1. In the application page, click on "Certificates & secrets."
  2. Under the "Client secrets" section, click "New client secret."
  3. Add a description and set an expiration period.
  4. Click "Add."
  5. Copy the generated client secret value. (Ensure to save it securely as you will not be able to view it again.)

Step 5: Collect Necessary Credentials

You will need the following credentials to configure n8n:

  • Application (client) ID: Found on the application page.
  • Directory (tenant) ID: Also found on the application page.
  • Client secret: The value you copied in the previous step.

Step 6: Configure n8n with Microsoft OAuth Credentials

Now that you have all necessary credentials, it's time to configure them in n8n.

  1. Open your n8n instance.
  2. Go to the "Credentials" section.
  3. Click on "New Credential."
  4. Select "Microsoft OAuth2" from the list of available credential types.
  5. Fill in the required fields:
    • Client ID: Enter your Application (client) ID.
    • Client Secret: Enter the client secret you generated.
    • Tenant ID: Enter your Directory (tenant) ID.
  6. Save the credentials.

Conclusion

You have successfully set up Microsoft OAuth credentials in n8n. With this integration, you can now create powerful workflows that leverage Microsoft services. To continue building your automation projects, explore the various triggers and actions available in n8n for Microsoft applications. If you encounter any issues, don't hesitate to reach out for help or consult the n8n documentation for further assistance.