Azure active directory 在.NET中使用特定用户强制MSAL登录

Azure active directory 在.NET中使用特定用户强制MSAL登录,azure-active-directory,msal,Azure Active Directory,Msal,有没有一种方法可以要求用户使用MSAL在交互模式下仅使用特定帐户登录Azure AD 我试过了 nativeclientap.AcquireTokenInteractive(作用域)。WithLoginHint(account.Username)。ExecuteAsync() 及 NativeClient.AcquireTokenInteractive(作用域).WithAccount(帐户).ExecuteAsync() 但两者都允许我选择用户。您可以使用和提示符(Prompt.NoPromp

有没有一种方法可以要求用户使用MSAL在交互模式下仅使用特定帐户登录Azure AD

我试过了

nativeclientap.AcquireTokenInteractive(作用域)。WithLoginHint(account.Username)。ExecuteAsync()

NativeClient.AcquireTokenInteractive(作用域).WithAccount(帐户).ExecuteAsync()


但两者都允许我选择用户。

您可以使用
和提示符(Prompt.NoPrompt)
来排除您不想选择的所有其他帐户

请尝试下面的代码:

NativeClientApp.AcquireTokenInteractive(scopes).WithPrompt(Prompt.NoPrompt).WithLoginHint("<account>").ExecuteAsync()
NativeClient.AcquireTokenInteractive(作用域).WithPrompt(Prompt.NoPrompt).WithLoginHint(“

使用带有提示符的
(Prompt.NoPrompt)


谢谢。但使用其他帐户登录仍然是一个链接。但我想这是我能在这里找到的最接近的东西。。。