我收到以下错误 "AADSTS90002 Tenant authorize not found."

I get the following error "AADSTS90002 Tenant authorize not found."

我正在开发一个通过以下方式获取数据的应用程序 Dynamics 365的OAuth 为此,请使用以下示例

https://www.youtube.com/watch?v=Td7Bk3IXJ9s

public static async Task Auth()
{
    string URL = "https://grupolg.api.crm.dynamics.com/api/data/v9.1/";

    AuthenticationParameters API = AuthenticationParameters.CreateFromResourceUrlAsync(new Uri(URL)).Result;

                                                  //APP KEY, SECRET KEY
    ClientCredential Creds = new ClientCredential("hidden for security", "hidden for security"); 


    AuthenticationContext authContext = new AuthenticationContext(API.Authority);
    string token = authContext.AcquireTokenAsync(API.Resource, Creds).Result.AccessToken;

    using (HttpClient httpClient = new HttpClient())
    {
        httpClient.Timeout = new TimeSpan(0,2,0);
        httpClient.DefaultRequestHeaders.Authorization =
                new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer",token);

        HttpResponseMessage res = await httpClient.GetAsync(URL+"/contacts$top=1");
    }
}

但我收到以下错误:

错误是由您使用的 ADAL 版本以及权限 URL 的生成方式引起的。

如果您将 Microsoft.IdentityModel.Clients.ActiveDirectory 库版本降级到 3.9.18,您将能够毫无问题地进行连接。有一个 open bug in GitHub,您可以在其中跟踪其进度或评论以添加更多信息以获得最终修复。