【问题标题】:Error : Tenant authorize not found. This may happen if there are no active subscriptions for the tenant错误:未找到租户授权。如果租户没有活动订阅,则可能会发生这种情况
【发布时间】:2019-05-08 22:21:48
【问题描述】:

我已经编写了以下代码来获取 CRM 的令牌。

class Program
{
    private const string username = "richa@azuretraining112.onmicrosoft.com";
    private const string password = "Pa$$w0rd";
    private const string serviceURL = "https://azuretraining112.crm8.dynamics.com";
    private const string applicationID = "89a70b76-3a71-481f-8755-a7aa97c59c35";
    private const string redirectURL = "https://localhost1";
    private const string authorityURI = "https://login.microsoftonline.com/1d54ea41-cd25-488f-812c-c078e6114065/oauth2/authorize";
    private static AuthenticationResult authResult = null;


    private static void Main(string[] args)
    {
        var credentials = new UserPasswordCredential(username, password);
        var context = new AuthenticationContext(authorityURI);
        authResult = context.AcquireTokenAsync(serviceURL, applicationID, credentials).Result;
    }
}

但是,在运行代码时,我在尝试使用 AcquireTokenAsync 获取令牌时遇到以下错误。

我使用应用程序 ID 添加了一个应用程序用户:

我不知道我错过了什么。请帮忙!

我尝试了Tenant not authorized 中给出的解决方案,但是没有任何效果。

谢谢!

【问题讨论】:

标签: c# azure dynamics-crm adal dynamics-365


【解决方案1】:

将此 url 配置为端口号“https://localhost1:5000”,并在 Azure AD 的回复 URL 中配置相同的“https://localhost1:5000”。

让我知道这是否有效

【讨论】:

    猜你喜欢
    • 2018-12-06
    • 1970-01-01
    • 2019-04-29
    • 2019-11-22
    • 2019-03-28
    • 1970-01-01
    • 2019-08-24
    • 2018-09-11
    • 1970-01-01
    相关资源
    最近更新 更多