the integration way for the on-premise environment is different from cloud environment,
For Cloud environment or OneBox we create application registration on Azure and enter the application Id in Azure Application in D365FO app.
For On-Premise environment we use ADFS to generate application and secret and register application Id in D365FO application.
Also still there are some difference in calling token api we will discuss later in this blog:
Step 1:
Navigate to ADFS server and open “Microsoft Dynamics 365 for Operations On-premises” from Application Group

Step 2:
click on Add Application and Name the application as describe your API if custom service or OData as below screenshoot

Step 3:
Select Server Application and click Next

Step 4:
Copy generated Client Identifier (Application Id)
Enter Application URL without “/namespaces/AXSF”

Step 5:
Copy Secret code in safe area as it will not appear again and only way if you lost it to generate new secret

Step 6:
Authorize the new server application to use the Web API and request OpenID connection authorizations.

Step 7:
After complete this setup, its necessary configure the Azure Active Directory applications
System administration –> Setup –> Azure Active Directory applications
And use the previously Client ID generated in the ADFS application.

Step 8:
Postman Configuration
Create a new environment with the following parameters
Variable | Value |
tenant_id | adfs |
client_id | «CLIENTID GENERATED IN THE ADFS APP» |
client_secret | «SECRET GENERATED IN ADFS» |
resource | Your AOS URL i.e «https://ax.d365ffo.onprem.contoso.com« |
grant_type | client_credentials |
Step 9:
Create new Request to get Token

In the body, set the reference to the global variables defined in the environment configuration
Key | Value |
tenant_id | {{tenant_id}} |
client_id | {{client_id}} |
client_secret | {{client_secret}} |
resource | {{resource}} |
grant_type | {{grant_type}} |
Step 10:
Copy the following script in Test
var json = JSON.parse(responseBody); tests[«Get Azure AD Token»] = !json.error && responseBody !== » && responseBody !== '{}' && json.access_token !== »; postman.setEnvironmentVariable(«bearerToken», json.access_token);
To test if everything is ok, you can click on Send and the bearer token is generated
Key | Value |
Content-Type | application/x-www-form-urlencoded |
Step 11:
Test DataEntity
You can get data for any entity, you only need set the following parameter in the Get
Type | Odata URL |
Get | {{resource}}/namespaces/AXSF/data/CustomersV3?$top=5 |
Header Parameters
Key | Value |
Authorization | Bearer {{bearerToken}} |
Content-Type | application/json |

Great post, Thank you