Asp.net Windows身份验证同时托管在具有ASPNet核心的Linux上

Asp.net Windows身份验证同时托管在具有ASPNet核心的Linux上,asp.net,.net,asp.net-core,dnx,.net-core,Asp.net,.net,Asp.net Core,Dnx,.net Core,我目前有一个在Windows上运行的自托管Owin应用程序,如下所示: public class Program { private static void Main(string[] args) { using (WebApp.Start<Startup>("http://localhost:9000")) { Console.WriteLine("Press Enter to quit.");

我目前有一个在Windows上运行的自托管Owin应用程序,如下所示:

public class Program
{
    private static void Main(string[] args)
    {
        using (WebApp.Start<Startup>("http://localhost:9000"))
        {
            Console.WriteLine("Press Enter to quit.");
            Console.ReadKey();
        }
    }
}

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        var listener = (HttpListener) app.Properties["System.Net.HttpListener"];
        listener.AuthenticationSchemes = AuthenticationSchemes.IntegratedWindowsAuthentication;

        app.UseNancy();
    }
公共类程序
{
私有静态void Main(字符串[]args)
{
使用(WebApp.Start(“http://localhost:9000"))
{
控制台。WriteLine(“按Enter键退出”);
Console.ReadKey();
}
}
}
公营创业
{
公共无效配置(IAppBuilder应用程序)
{
var listener=(HttpListener)app.Properties[“System.Net.HttpListener”];
listener.AuthenticationSchemes=AuthenticationSchemes.IntegratedWindowsAuthentication;
app.UseNancy();
}
当请求传入时,用户将使用其Windows域凭据进行验证

对于ASPNetCore,我想知道是否有类似的设置可以使用,但应用程序使用Kestrel web服务器在Linux上运行

我听说各种选项,如Windows 2016和OpenIdConnect中间件可能会起作用,或者我可以使用运行在Windows上的IdentityServer,但Linux上的应用程序是必需的,但我认为中间件是必需的,我也不清楚是否会出现“身份验证舞蹈”,这意味着它可能不像我目前所做的那样无缝

如有任何建议和/或代码示例,将不胜感激


谢谢

Kestrel在任何平台上都不直接支持Windows auth,也没有任何可用的中间件支持Linux上的Windows auth

通过Windows服务器路由登录请求是您唯一的选择。IdentityServer将是一个很好的起点。OpenIdConnect可能是在用户交互最少的两台服务器之间传递身份的最佳选择