n8n-docs/docs/integrations/builtin/credentials/microsoft.md
2024-06-03 11:22:17 -04:00

5.6 KiB

title description contentType
Microsoft credentials Documentation for Microsoft credentials. Use these credentials to authenticate Microsoft in n8n, a workflow automation platform. integration

Microsoft credentials

You can use these credentials to authenticate the following nodes:

Prerequisites

  • Create a Microsoft Azure{:target=_blank .external-link} account.
  • Create at least one user account with access to the appropriate service.

Supported authentication methods

  • OAuth2

Refer to the linked Microsoft API documentation below for more information about each service's API:

  • Dynamics CRM: Web API{:target=_blank .external-link}
  • Excel: Graph API{:target=_blank .external-link}
  • Graph Security: Graph API{:target=_blank .external-link}
  • OneDrive: Graph API{:target=_blank .external-link}
  • Outlook: Graph API{:target=_blank .external-link} and Outlook API{:target=_blank .external-link}
  • Teams: Graph API{:target=_blank .external-link}
  • To Do: Graph API{:target=_blank .external-link}

Using OAuth2

--8<-- "_snippets/integrations/builtin/credentials/cloud-oauth-button.md"

Some Microsoft services require extra information for OAuth2. Refer to Service-specific settings for more guidance on those services.

To configure OAuth2 from scratch, register an application with the Microsoft Identity Platform{:target=_blank .external-link} and follow the instructions below:

  1. Open the Microsoft Application Registration Portal{:target=_blank .external-link}.
  2. Select Register an application.
  3. Enter a name for your app in the Name field.
  4. In Supported account types, select Accounts in any organizational directory (Any Azure AD directory - Multi-tenant) and personal Microsoft accounts (for example, Skype, Xbox).
  5. In Register an application:
    1. Copy the OAuth Callback URL from your n8n credential.
    2. Paste it into the Redirect URI (optional) field.
    3. Select Select a platform > Web.
  6. Select Register to finish creating your application.
  7. Copy the Application (client) ID.
  8. Paste it into n8n as the Client ID.
  9. On your Microsoft application page, select Certificates & secrets in the left sidebar.
  10. In Client secrets, select + New client secret. Refer to the instructions in Add credentials{:target=_blank .external-link} for further details.
  11. Enter a description in the Description field, such as n8n credential.
  12. Select Add.
  13. Copy the Secret in the Value column.
  14. Paste it into n8n as the Client Secret.
  15. If you see other fields in the n8n credential, refer to Service-specific settings below for guidance on completing those fields.
  16. Select the circle button in the OAuth section to connect a Microsoft account to n8n.
  17. Log in to your Microsoft account and allow the app to access your info.

For more detail on the Microsoft OAuth2 web flow, refer to Microsoft authentication and authorization basics{:target=_blank .external-link}.

Service-specific settings

The following services require extra information for OAuth2:

Dynamics

Dynamics OAuth2 also requires these fields:

  • Your Domain
  • Region: Select the Dynamics datacenter region you're within. Refer to the Microsoft Datacenter regions documentation{:target=_blank .external-link} for more information on the options and corresponding URLs.

Microsoft (general)

The general Microsoft OAuth2 also requires these fields:

Outlook

Outlook OAuth also requires these fields:

  • Use Shared Inbox: The API supports accessing a user's primary email inbox or a shared inbox. Turning this on indicates that the credential should access a shared inbox. If selected, you'll also need:
    • User Principal Name: Enter the target user's UPN or ID.