【问题标题】:Hang in Microsoft.Identity.Client trying to acquire auth token interactively the second time挂在 Microsoft.Identity.Client 尝试第二次以交互方式获取身份验证令牌
【发布时间】:2021-06-24 08:19:03
【问题描述】:

我正在通过 Mailkit 从 C# Windows Forms 项目(.NetFramework 4.8)进行 Azure AD 连接,我成功连接了一次,但再次尝试连接后,代码就挂在该行上;

var authToken = await publicClientApplication.AcquireTokenInteractive(scopes).ExecuteAsync();

如果我在控制台项目上运行相同的代码,它每次都在工作并打开 Outlook 框架,但在我的项目上它现在无法正常工作。谁能帮我急救?

我将我的代码从要点分享给你。

My Code Lines on Gist

【问题讨论】:

    标签: c# azure desktop-application msal


    【解决方案1】:

    我了解您当前的问题,即您的应用程序在初始令牌运行后未按计划执行。我建议彻底调试您的应用程序以确定具体问题并与我们分享,以便我们进一步调查。

    为了获得进一步的指导,这里有一个示例演练: https://cmatskas.com/modern-authentication-with-azure-ad-for-winforms-native-apps-2/

    【讨论】:

      猜你喜欢
      • 2015-09-14
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      • 1970-01-01
      • 2016-08-23
      • 2015-06-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多