Windows Authentication whilst hosted on Linux with ASPNet Core

Viewed 1807

I currently have a self hosted Owin application that is run on Windows like so:

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();
    }

When a request comes in, the user is validated using their Windows domain credentials.

For ASPNetCore I was wondering whether there was a similar setup that could be used but the application run on Linux using the Kestrel web server.

I've heard various options such as Windows 2016 and OpenIdConnect middleware might work or I could use IdentityServer running on Windows but the app on Linux but I assume middleware would be required, I'm also unclear if there would be a "authentication dance" implying it might not be seamless like I currently have.

Any advice and/or code examples would be greatly appreciated.

Thanks

1 Answers
Related