I'm slightly confused on how to register an app in my Azure Active Directory. I'm running a Microsoft Dynamics CRM on-Demand app at <myorg>.crm4.dynamics.com
. In order to run some simple blackbox tests I decided to write a small Java-based web client, by using ADAL4J and using the CRM Web api. From what I've understood I need to register my application in the AAD. Am I right to assume to register it as native? Since it is running merely some Request/Post-Requests locally? What do I need to configure for the redirect-uri in this use-case?
In a process of trial & error I registered an app with my resource-uri (<myorg>.crm4.dynamics.com
) as the redirect-uri and granted the necessary permission to access the Dynamics CRM Api. To my surprise it worked and I was able to retrieve an access token using the respective client id. The reason why I am still asking the question here is because the configuration I took still felt wrong to me. It isn't my CRM-App at <myorg>.crm4.dynamics.com
which I need to register but the Web Client which accesses the API with requests like <myorg>.crm4.dynamics.com/api/data/v9.0/accounts
, right?
To consume Dynamics CRM webapi from Java based web client, you have to register the CRM app (not the Java app) in Azure AAD & Application Id (earlier called as Client Id) can be used to get the token for authentication.
Walkthrough: Register a Dynamics 365 app with Azure Active Directory