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.


Business Central OAuth2 Account

Prerequisites

Account settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label*

String

Specify a unique label for the account.

Default value: N/A

Example: Business Central OAuth2 Production Account
Instance URL*

String/Expression

Specify the host URL of the Business Central application in the following format: https://api.businesscentral.dynamics.com/v2.0/<environment-name>/api/v2.0

Default value: N/A

Example: https://api.businesscentral.dynamics.com/v2.0
Client ID*

String/Expression

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

String/Expression

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

String

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

String

Specify the authorization endpoint to obtain the access token. Replace the tenant ID placeholder with the tenant ID from your registered application.

Default value: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize

OAuth2 token endpoint

String

Specify the token endpoint to obtain the access token. Replace the tenant ID placeholder with the tenant ID from your registered application.

Default value: https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token

Grant type

Dropdown list

Select one of the grant types for authentication:
  • authorization code: Authenticates using credentials (username and password), which return to the client through a redirect URL. The application then receives the authorization code from the URL and uses it to request an access token.
  • client credentials: Obtains an access token for the client ID and client secret through the token endpoint URL.
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

String

Specify the name for the token endpoint parameter.

Default value: N/A

Example: Scope
Token endpoint parameter value

String

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

String

Specify the authentication parameter.

Default value: N/A

Example: Scope, redirect_uri
Authentication parameter value

String

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.