【发布时间】:2019-05-07 19:03:35
【问题描述】:
尝试从我的 .Net 客户端使用 Dynamics 365 进行身份验证时遇到以下错误:
AADSTS90002: Tenant authorize not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.
这是我目前使用的代码:
AuthenticationParameters authenticationParameters = AuthenticationParameters.CreateFromResourceUrlAsync(new Uri("https://dev-aec-ssp.api.crm6.dynamics.com/api/data/v9.1/")).Result;
AuthenticationContext authenticationContext = new AuthenticationContext(authenticationParameters.Authority, false);
ClientCredential clientCredential = new ClientCredential("9cd8fe45-xxxx-xxxx-xxxx-e43ef81c803f", "abcdefghijk");
AuthenticationResult authenticationResult = null;
try
{
authenticationResult = authenticationContext.AcquireTokenAsync("https://dev-aec-ssp.api.crm6.dynamics.com", clientCredential).Result;
}
catch (Exception ex)
{
throw new Exception("Failed to authenticate with remote Dynamics service.", ex);
}
AcquireTokenAsync 总是失败。
【问题讨论】:
标签: c# azure dynamics-crm adal dynamics-crm-online