Connect to Dynamics 365 Customer Engagement web services using OAuth

元气小坏坏 提交于 2020-01-06 01:22:51

问题


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:


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.



来源:https://stackoverflow.com/questions/49692322/connect-to-dynamics-365-customer-engagement-web-services-using-oauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!