1
votes

I am trying to connect to dynamics 365 by using the reference given in the link below

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/connect-customer-engagement-web-services-using-oauth

After User authentication at the below code, control goes to catch block saying

"The request body must contain the following parameter: 'client_secret or client_assertion'"

AuthenticationResult result = authContext.AcquireToken(resource, clientId, new Uri(redirectUrl));

I understand that for other Microsoft Apps there is a client App key and client Secret key with which we can acquire access token, But this is an Azure directory App which has only Client App key. Please Correct me if my understanding is wrong.

1

1 Answers

1
votes

What version of ADAL are you using? Looks like you need to be 2.x for it to work. From that documentation page you linked:

You must use the ADAL 2.0 libraries. All Dynamics 365 Customer Engagement tools, assemblies, and utilities require the patterns supported by ADAL 2.0. The ADAL 3.0 libraries require a sign-in screen to capture user account information and do not provide for passing this account information in a headless fashion as required by Dynamics 365 Customer Engagement.

I'm looking at my last snippet of test code which uses v2.29 and I don't have an AcquireToken method with those parameters.