Logo
banner

Blogs

Integration of Business Central APIs and Web Services with OAuth

, February 20, 2024 410 Views

Microsoft Dynamics 365 Business Central is a powerful Enterprise Resource Planning (ERP) solution that offers a wide range of customization options to meet the unique needs of your business. One such customization is to connect Business Central APIs and Web Service with OAuth. Microsoft Dynamics 365 Business Central, offers a set of powerful APIs and web services that allow businesses to connect and streamline their processes. To ensure secure and controlled access to these resources, OAuth has become a popular authentication protocol. In this blog post, we’ll explore how OAuth can be utilized to connect Business Central APIs and web services, ensuring efficient data exchange and integration.

Requirement:

We recently encountered a requirement where we need to integrate Business central APIs and Web Services with OAuth for efficient data Exchange.

Prerequisites:

  • Access to a Dynamics 365 Business Central instance with administrator privileges.
  • Access to a Microsoft Azure Portal

What is OAuth?

OAuth, or Open Authorization, is an open standard and protocol that allows secure third-party access to a user’s resources without exposing their credentials. It is commonly used for enabling delegated access and authorization in the context of web applications and APIs. OAuth is designed to address the challenges of resource owners (users) granting access to their information stored on one site (the service provider) to another site (the consumer) without sharing their credentials.

  • Resource Owner (User): The resource owner is the entity that owns the resource and is capable of granting access to it. This is typically the end-user.
  • Client: The client is the application requesting access to the user’s resources. This could be a web application, mobile app, or any other software.
  • Authorization Server: The authorization server is responsible for authenticating the resource owner and providing authorization to the client. It issues access tokens after the resource owner grants consent.
  • Resource Server: The resource server hosts the protected resources that the client wants to access. It validates access tokens presented by the client and grants or denies access accordingly.
  • Access Token: The access token is a credential that represents the authorization granted to the client. It is a string representing the authorization granted and is used by the client to access the protected resources.

Solution (Implementation Steps):

The integration process involves several key steps to ensure a smooth and secure connection:

Step 1: Access to Azure Portal.

Step 2: Search for “App registrations” and then choose the related link.

Step 3: To create a new app registration, choose “New registration”.

Step 4: Now Enter the “Name”, select “account type”, then choose “Register”.

Step 5: Go to “Authentication”, choose “Add a platform” and select “Web”.

Step 6: Enter the “redirect URl” of the application, and then choose “Configure”. For example: https://businesscentral.dynamics.com/

Step 7: Go to “API Permissions”, choose “Add a permission” & Find “Dynamics           365 Business Central” and click it.

Step 8: You can choose the required permissions according to your situation. For example: Choose Delegated permissions.

Step 9: Select the permissions, and then choose Add permissions.

Step 10: Choose Add a permission again, Click Dynamics 365 Business Central     Central and Select Application permissions this time.

Step 11: Select the permissions you need, then choose Add permissions.

Step 12: Choose “Grant admin consent for Contoso” and click on Yes.

Step 13: Go to “Certificates & secrets”, Choose “New Client secret” & Enter “Description” and select “Expires”, then choose “Add”.

Step 14: The settings in Azure Portal is over.

NOTE: Don’t Forget to get “Client Secret ID” & “Value”. You can access the application (Client) ID from “Overview”. From “Endpoint”, you can get the “access token”. (See below Images)

Step 15: Log in to the BC environment you need to connect, and enter “Microsoft Entra Application” in tell me, then choose the related link.

Step 16: Click on “+New” and Enter “Client ID” and “Description”. For example:

Client ID: {3d009cdc-f25b-400c-9c4e-bed75156c552}

Description: BC_Integration

Step 17: Then assign permissions as shown in below image and confirm that the State is Enabled.

Permissions: D365 BUS PREMIUM

D365 FULL ACCESS

D365 FINANCE

Note: Super is not allowed.

Step 18: Business Central APIs can be accessed from “Web-Service”. Enter “Web service” in tell me, then choose the related link. To Access API select “OData V4 URL”.

Conclusion:

In conclusion, the integration of Business Central APIs and Web Services with OAuth is not just a technical requirement; it’s a strategic move towards a more efficient, secure, and controlled data exchange environment. By understanding the prerequisites, exploring the power of OAuth, and following the outlined integration steps, businesses can unlock the full potential of Microsoft Dynamics 365 Business Central, paving the way for a future-ready and optimized ERP ecosystem


Know the number of records in any Dataverse entity or table.
https://www.inkeysolutions.com/entity-record-counter

ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://www.inkeysolutions.com/microsoft-power-platform/power-app/atm-inspection

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox

Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr

Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator

mm

Inkey

INKEY is your solution partner.
Our focus is to deliver you in-time intelligent innovative solutions ("key") for the problems in hand. Maintaining a quality standard right from the inception of a project is our top most priority.

Our team of talented professionals will execute your projects with dedication and excellence. We take ownership and accountability for the effort that goes into meeting our client’s needs.

Years of experience and proven success of delivering innovative custom solutions.

More posts by

Leave a Reply

Your email address will not be published. Required fields are marked *

The maximum upload file size: 2 MB. You can upload: image, audio, video, document, spreadsheet, interactive, text, archive, code, other. Drop file here

Would you like to digitize your business and put it on the cloud?
Do you need clear, concise reports for your organization?