Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP.Net核心:IIS Active Directory身份验证-不使用池标识_C#_Asp.net_Asp.net Core_Asp.net Core Mvc - Fatal编程技术网

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

C# ASP.Net核心:IIS Active Directory身份验证-不使用池标识,c#,asp.net,asp.net-core,asp.net-core-mvc,C#,Asp.net,Asp.net Core,Asp.net Core Mvc,我们的ASP.NET核心应用程序与Windows身份验证配合良好,可通过以下方式正确保护应用程序: [Authorize(Roles = "ABC\\MyGroup")] 但是,当我们将应用程序移动到另一台服务器时,运行应用程序的池没有访问Active Directory的权限。在Setup.cs中,我如何告诉ASP.Net Core使用特定帐户访问Active Directory以对请求进行身份验证 我不是在问应用程序中的模拟,应用程序需要简单地访问广告,以便确定用户是否可以访问控制器

我们的ASP.NET核心应用程序与Windows身份验证配合良好,可通过以下方式正确保护应用程序:

[Authorize(Roles = "ABC\\MyGroup")]
但是,当我们将应用程序移动到另一台服务器时,运行应用程序的池没有访问Active Directory的权限。在Setup.cs中,我如何告诉ASP.Net Core使用特定帐户访问Active Directory以对请求进行身份验证

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

        services.AddAuthentication(IISDefaults.AuthenticationScheme);

        services.Configure<IISOptions>(options => {
            options.AutomaticAuthentication = true;
            options.ForwardClientCertificate = true;
            options.AuthenticationDisplayName = "EnterAccount";
        });
services.AddAuthentication(IISDefaults.AuthenticationScheme);
配置(选项=>{
options.AutomaticAuthentication=true;
options.ForwardClientCertificate=true;
options.AuthenticationDisplayName=“entercount”;
});
解决方案:

将此添加到Web.config

  <aspNetCore forwardWindowsAuthToken="true"

我不太明白。ASP.NET Core本身不支持任何AD/Windows身份验证。IIS是通过IIS集成中间件将身份传递给应用程序的。将windows auth与ASP.NET核心结合使用的唯一其他方法是使用http.sys(以前称为WebListener)作为平台(而不是kestrel)。但是,您不能在IIS中托管它,而必须自行托管它。您的问题与ASP.NET Core per see无关,您必须确保您的IIS具有执行此操作所需的权限。ASP.NET Core未参与此项活动不是IIS专家,但唯一的方法是允许应用程序池访问广告或创建新的应用程序池(如果您不希望该池中的其他应用程序获得此类权限)