Dynamics 365 Business Central - OAuth
Dynamics 365 Business Central OAuth 2.0
Overview
Dynamics Mobile portal must configured to communicate with Dynamics 365 Business Central. The communication with Dynamics 365 Business Central requires Dynamics Mobile portal to authenticate against Dynamics 365 Business Central and the prefered authentication method is called Service-to-Service authentication, which uses OAuth under the hood . You find more information about the subject here
Dynamics Mobile supports OAuth authentication and this requires certain configurations to be made on the Azure, Dynamics 365 Business Central and Dynamics Mobile Portal.
Prerequisites
Dynamics 365 Business Central instance hosted in Microsoft Cloud
Administrative access to https://portal.azure.com
Administrative access (FULL ACCESS) to the Dynamics 365 Business Central instance
Configuring Dynamics 365 Business Central
Go to https://portal.azure.com and login with your administrative account
Navigate to menu Microsoft Entra ID/App Registrations
Click on New Registration button on top
Enter Dynamics Mobile in the Name field
Select the first option from Supported account types
Select Web and enter the following url in Redirect URI: https://businesscentral.dynamics.com/OAuthLanding.htm
7. Click the register button Register
8. Copy the Client ID and Tenant Id values - we will need those in the Dynamics Mobile Portal.
9. Now go to the API permissions section of the newly registered app and click Add Permission
10. Select Dynamics 365 Business Central and then click Application permissions
11. Click Application permissions and then check Financials.ReadWriteAll
12. Check All of of the checkboxes like and then click button Add permissions
13. Click Grant Admin Consent for .......
14. Go to Certificate and secrets and click New Client secret
15. Enter Description, Expires: 24 months and click the Add button
Don't forget to copy the Value field and store it as we we enter this value as a CLIENT SECRET in Dynamics Mobile Portal.
16. Go to your Microsoft Dynamics Business Central instance ,click Search, enter Entra and click over Microsoft Entra Applications
17. Click New to create new app.
18. Enter Description, Client Id (from step 8) and the User Groups and User Permission Sets as given below
Make sure you click the GRANT CONSENT button to grant access to the app once all other fields are setup correctly.
So far you need to have the following values copied and prepared for the next step:
Client Id (step 8)
Tenant Id (step 8)
Client Secret (step 15)
Dynamics Mobile Portal Configuration
Dynamics Mobile Portal also needs to be configured.
Configuring the connection with Business Central
Go to the Dynamics Mobile Portal and login to the appropriate application area
Go to application ADM
Go to roles
Create role with code DMSAGENT and name DMSAGENT
Click the CREATE button on top
Open the DMSAGENT role again and go to the role Settings section , then click over AGENT
Select SaaS from Agent Deployment Type
Click over Backend Connection section
Select Microsoft Dynamics 365 Business Central from Connection Type
Select Microsoft Cloud from Business Central Deployment Type
Enter Tenant Id (step 8) and Environment Id - this is the Business Central Environment Id.
Enter the copied client ID from step 8 in Client Id field
Enter the copied client secret from step 8 in Client Secret field
Enter the default display company name from Business Central in the Company field
Click the UPDATE button on top
Last updated