1. Setting up OAuth 2.0 for Business Central Integration
Enabling and Configuring OAuth on the Azure Portal
STEP 1: Login to the Azure portal (https://portal.azure.com/)
STEP 2: In the Azure portal, find "App registrations" or use the search function to find it.
STEP 3: On the App registrations page, click on “New registration”.
STEP 4: Choose a name for the application and who can use this app or access API. In this example we are using single tenant. In the Redirect URL select the web and enter the business central URL to register your application.
STEP 5: Next, we need to grant the API permission. Click on “API permissions” on the menu and then click “Add a permission”
STEP 6: After clicking “Add a permission”, the available API permissions will pop up. If you can’t see Business Central, it is because the user doesn’t have a valid license.
STEP 7: Click on Delegated Permissions and add “user_impersonation” and “Financials.ReadWrite.All”.
STEP 8: Repeat STEP 6 to add application permissions. Click on Application permissions and check “app_access”, “API.ReadWrite.All”, and “Automation.ReadWrite.All”.
STEP 9: After adding permissions, we go back to the API permissions page. We will click on “Grant admin consent”
STEP 10: Click on “Yes” to grant admin consent. All permissions will display “Granted for”
STEP 11: Next, we need to add the new client secret, for that go to the "Certificates and secrets" in the menu, and click on "New client secret".
STEP 12: Enter client secret description and assign when it expires.
STEP 13: After adding the client secret we can see that our client secret is added in the "Certificates and secrets" page, now copy and save the client secret value in the notepad, as we will need it later for token generation in Postman. Client secret values cannot be viewed, except for immediately after creation. Be sure to save the secret when created before leaving the page.
STEP 14: Now, go back to the Overview section. Copy and save the Application (client) ID in the notepad as well, this Id is also required for token generation in Postman.
STEP 15: Click on the Endpoints in the Overview page to find authorization and token URLs. These URLs will be used to authorize and generate a token for the request