首页 文章

ASP.Net核心:IIS Active Directory身份验证 - 不使用池标识

提问于
浏览
0

我们的ASP.NET核心应用程序适用于Windows身份验证,正确保护应用程序:

[Authorize(Roles = "ABC\\MyGroup")]

但是,当我们将应用程序移动到另一台服务器时,运行该应用程序的池无权访问Active Directory . 在Setup.cs中,如何告诉ASP.Net Core使用特定帐户访问Active Directory以对请求进行身份验证 .

我不是在应用程序中询问模拟,应用程序需要简单访问AD,以便它可以确定用户是否可以访问控制器

services.AddAuthentication(IISDefaults.AuthenticationScheme);

        services.Configure<IISOptions>(options => {
            options.AutomaticAuthentication = true;
            options.ForwardClientCertificate = true;
            options.AuthenticationDisplayName = "EnterAccount";
        });

1 回答

  • 0

    解:

    将其添加到Web.config中

    <aspNetCore forwardWindowsAuthToken="true"
    

    我在博客上写了一篇完整的solution here .

相关问题