Business Central OAuth2 Account
Overview
Use this account type to connect Business Central Snaps with the Microsoft Dynamics 365 Business Central application that requires OAuth2 authorization.

Prerequisites
- A registered application in the Microsoft Azure Portal with required permissions to generate the access token. Refer to Application Configuration in Microsoft Azure Portal for OAuth2 Account to use in Business Central for more information.
Account settings
| Field/Field set | Description |
|---|---|
| Label*
|
Specify a unique label for the account. Default value: N/A Example: Business Central OAuth2 Production Account |
| Instance URL*
|
Specify the host URL of the Business Central application in the following format:
Default value: N/A Example: https://api.businesscentral.dynamics.com/v2.0 |
| Client ID*
|
Specify the Client ID obtained from the Azure Portal. This is the unique identifier for your registered application. Default value: N/A Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
| Client Secret
|
Specify the Client Secret obtained from the Azure Portal. This is the secret key associated with your application. Default value: N/A Example: aBc123dEf456~gHi789-jKl012 |
| Access token
|
Auto-populated after authorization. The access token for the OAuth2 application to make API requests for the user associated with the client ID. |
| Refresh token | The refresh token for the application. The retrieval of the refresh token is done when setting up the account for the endpoint. There, the OAuth2 flow will be executed and the resulting refresh token can be stored in this field. If the refresh token is stored, then the access token can be refreshed automatically before it expires. |
| Access token expiration | Auto-populated after authorization. The access token expiration value. |
| OAuth2 authorization endpoint
|
Specify the authorization endpoint to obtain the access token. Replace the tenant ID placeholder with the tenant ID from your registered application. Default value: |
| OAuth2 token endpoint
|
Specify the token endpoint to obtain the access token. Replace the tenant ID placeholder with the tenant ID from your registered application. Default value: |
| Grant type
|
Select one of the grant types for authentication:
|
| Token endpoint config |
Use this field set to define custom properties for the OAuth2 token endpoint. This endpoint returns access tokens or refresh tokens based on the request parameters. |
| Token endpoint parameter
|
Specify the name for the token endpoint parameter. Default value: N/A Example: Scope |
| Token endpoint parameter value
|
Specify the value for the token endpoint parameter. Default value: N/A Example: https://api.businesscentral.dynamics.com/.default offline_access |
| Authorization endpoint config | Use this field set to define custom properties for the OAuth2 authentication endpoint. |
| Authentication parameter
|
Specify the authentication parameter. Default value: N/A Example: Scope, redirect_uri |
| Authentication parameter value
|
Specify the associated value for the authentication parameter. Default value: https://api.businesscentral.dynamics.com/.default Example: https://elastic.snaplogic.com/sl/login.html /> |
| Auto-refresh token | Refreshes the token automatically using the refresh token if the property is enabled. Otherwise, the token might expire and will not be automatically refreshed. |
| Authorize | Click the Authorize button to authenticate the account. |
Troubleshooting
| Error | Reason | Resolution |
|---|---|---|
| Authentication failed. | You entered an incorrect Client ID or Client secret. | Ensure that you have provided valid Client ID and Client secret values for the account and allowed the required access privileges to the application. Reauthorize the account and retry. |