不确定您处理的限制是什么。但是,您提到的门户是为 Azure AD V2.0 端点注册应用程序。
在您的场景中为 Azure AD 帐户提供单独的登录按钮是否有帮助?如果是,您可以参考以下代码:
提供两个按钮来选择要登录的帐户:
<input type="button" value="AzureAD" onclick="location.href='@Url.Action("SignIn", "Account",new { provider="aad"} )'" />
<input type="button" value="Microsoft" onclick="location.href='@Url.Action("SignIn", "Account",new { provider="microsoft"} )'" />
账户控制人:
public void SignIn(string provider,string ReturnUrl = "/")
{
if (!Request.IsAuthenticated)
{
if ("aad" == provider)
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = ReturnUrl }, OpenIdConnectAuthenticationDefaults.AuthenticationType);
else
HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = ReturnUrl }, "Microsoft");
}
}
启动.cs
app.UseMicrosoftAccountAuthentication(
clientId: "",
clientSecret: "");
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
ClientId = "",
Authority = "",
});