logo

MS Business Central | Create an OAuth2 Connection

Quick guide to create a Microsoft Business Central API connection for n8n.io

Azure Portal Application

1

Navigate to Azure Portal

2

Click on the search bar

Click on the search bar
3

Click on "App registrations"

Click on "App registrations"
4

Click on "New registration"

Click on "New registration"
5

Enter Application Name: "n8n Connector" and select "Single tenant"

Enter Application Name: "n8n Connector" and select "Single tenant"
6

Click on "Register"

Click on "Register"
7

Click on "Authentication"

Click on "Authentication"
8

Click on "Add a platform"

Click on "Add a platform"
9

Select "Web Application"

Select "Web Application"
10

Enter Redirect URIs as: "https://businesscentral.dynamics.com/OAuthLanding.htm" & Click on Configure

Enter Redirect URIs as: "https://businesscentral.dynamics.com/OAuthLanding.htm" & Click on Configure
11

Click on "API permissions"

Click on "API permissions"
12

Click on "Add a permission"

Click on "Add a permission"
13

Click on "Dynamics 365 Business Central"

Click on "Dynamics 365 Business Central"
14

Click on "Delegated permissions"

Click on "Delegated permissions"
15

Add the necessary permissions

Add the necessary permissions
16

Add "API.ReadWrite.All" permission

Add "API.ReadWrite.All" permission
17

Click on "Add permissions"

Click on "Add permissions"
18

Click on "Grant admin consent for integrocloudsolutions.com"

Click on "Grant admin consent for integrocloudsolutions.com"
19

Click on "Yes"

Click on "Yes"
20

Click on "Certificates & secrets"

Click on "Certificates & secrets"
21

Click on "New client secret"

Click on "New client secret"
22

Click on "Add"

Click on "Add"
23

Copy Secret Value & Secret ID

Copy Secret Value & Secret ID
24

Copy "Client ID"

Copy "Client ID"
25

Copy Tenant ID

Copy Tenant ID
26

Login into Dynamics 365 Business Central and search for "Entra"

Login into Dynamics 365 Business Central and search for "Entra"
27

Click on "Microsoft Entra Applications"

Click on "Microsoft Entra Applications"
28

Click on "New"

Click on "New"
29

On Client ID enter your "n8n Connector" Client ID from previous steps

On Client ID enter your "n8n Connector" Client ID from previous steps
30

Click on "Yes"

Click on "Yes"
31

Add the necessary permission sets for you app

Add the necessary permission sets for you app
32

Click on "Grant Consent"

Click on "Grant Consent"
33

Select the User Account to grant consent

Select the User Account to grant consent
34

Click on "OK"

Click on "OK"
35

Done 🚀

Done 🚀

Business Central Company ID

36

Click on the search icon

Click on the search icon
37

Search & click on "Companies"

Search & click on "Companies"
38

Select the company to get the ID from

Select the company to get the ID from
39

Click on "Help & Support"

Click on "Help & Support"
40

Click on "Inspect pages and data"

Click on "Inspect pages and data"
41

Validate the Name field contain the company name you are looking for

Validate the Name field contain the company name you are looking for
42

Click on the search icon and type "Id"

Click on the search icon and type "Id"
43

Copy the Company Id value

Copy the Company Id value

Create n8n.io Credential

At this point you must have identified the values for: Tenant ID, Client ID, Secret ID, Secret Value & Company ID

44

Go to n8n.io and click Credentials / Add Credential

Go to n8n.io and click Credentials / Add Credential
45

Click on "OAuth2 API" 🔍

Click on "OAuth2 API" 🔍
46

Click on "Continue"

Click on "Continue"
47

Set a credential name

Set a credential name
48

Enter below details ⌨️

Grant Type: Client Credentials

Access Token URL https://login.microsoftonline.com/{tenandId}/oauth2/v2.0/token

Client ID {ClientId}

Secret Value {Secret Value}

Scope https://api.businesscentral.dynamics.com/.default

Authentication Body

**Enter below details** ⌨️

**Grant Type:**
*Client Credentials*

**Access Token URL**
*https://login.microsoftonline.com/{tenandId}/oauth2/v2.0/token*

**Client ID**
*{ClientId}*

**Secret Value**
*{Secret Value}*

**Scope**
*https://api.businesscentral.dynamics.com/.default*

**Authentication**
*Body*
49

Credential successfully created ✅

Credential successfully created ✅