Introduction
This wiki explains how to get access using OAuth from Postman to a Business Central environment. As a pre requisite the BC environment should be configured to use AAD.
High level steps
- Create a cleint registration in Azure Portal
- Create access token in Postman
Create client registration in Azure Portal
Go to Azure Portal
Select Azure Active Directory ==> App Registrations
Create new App registration
-- Give it a unqiue name -- Select multi tenant / single tenant depending on your need
Press registration button to create
Select Authentication
Choose Add platform and select web. Screen below will popup
-- Set logon URL. (Value is not relevant, except it should be https) -- Select checkbox "Access tokens"
For implicit flows, copy the App Client ID
Create access token in Postman
Start Postman
Go to the Authorization tab -- Authorization Type: OAuth 2.0 -- Add auth data to: Request Headers
Click on "Get new Acces token" -- Token Name: Name of this token -- Grant Type: Implicit -- Callback URL: Redirect URI of the Azure registration -- Auth URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize -- Client ID: Client ID of the Azure registration -- Scope: https://api.businesscentral.dynamics.com/user_impersonation -- State: State -- Client Authentication: Send client credentials in body
Click on "Request Token"
The first time a popup appears to log on to Azure
Scroll down and click on "Use Token"