To access Online Management API first thing we need to do is register Dynamics CRM app with Azure AD so that our console application can have access to it.
To register App with Azure AD:
- Navigate to Azure Portal. (Even if you are using trial account it will work).
- Go to Azure Active Directory -> “App registration”
- Click “New Application Registration”
- Key in the Details
- Once App is Created you can see app details. Application ID is the Client ID we require for the app authentication, Keep Application ID with you for authenticating through Client App.
- To provide this app permission to Dynamics CRM Online Management API click on Required Permissions -> Add -> Select an API
- Select Dynamics CRM Online from list
- Once “Dynamics CRM Online” is selected, click “Select Permissions” -> “Access CRM Online Organization users” -> “Select”.
After following above steps you will be able to Authenticate from your custom native app to Online Management API.