使用OAuth连接到Dynamics 365客户参与Web服务 [英] Connect to Dynamics 365 Customer Engagement web services using OAuth

查看:83
本文介绍了使用OAuth连接到Dynamics 365客户参与Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用下面的链接中给出的引用连接到Dynamics 365

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

https://docs.microsoft.com/zh-cn/dynamics365/customer -engagement / developer / connector-customer-engagement-web-services-using-oauth

在以下代码进行用户身份验证后,控制转到catch块

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


请求正文必须包含以下参数:'client_secret或client_assertion'

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



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

我了解,对于其他Microsoft Apps,我们可以使用客户端App密钥和客户端密钥获取访问令牌,但这是一个仅具有客户端应用程序密钥的Azure目录应用程序。如果我的理解有误,请纠正我。

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.

推荐答案

您使用的是哪个版本的ADAL?看起来您需要2.x才能正常工作。在该文档页面中,您链接了以下内容:

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:


您必须使用ADAL 2.0库。所有Dynamics 365客户参与工具,程序集和实用程序都需要ADAL 2.0支持的模式。 ADAL 3.0库需要一个登录屏幕来捕获用户帐户信息,并且不提供Dynamics 365客户参与所要求的无头方式传递此帐户信息。

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.

我正在查看使用v2.29的最后一个测试代码片段,我没有带有这些参数的 AcquireToken 方法

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.

这篇关于使用OAuth连接到Dynamics 365客户参与Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆