CondenserDotNet icon indicating copy to clipboard operation
CondenserDotNet copied to clipboard

Is it possible to use WindowsAuthentication middleware without ListenOptions?

Open sandrakim90 opened this issue 6 years ago • 0 comments

I keep my URL/port number in hosting.json like this:

{ "urls": "http://*:8075" }

i would like to build my host like this:

        var config = new ConfigurationBuilder()
             .AddJsonFile("hosting.json", optional: false)
             .Build();

        var builder = WebHost.CreateDefaultBuilder(args)
            .CaptureStartupErrors(true)
            .UseSetting(WebHostDefaults.DetailedErrorsKey, "true")
            .UseKestrel()
            .UseConfiguration(config)  //Will read "urls" key from hosting.json
            .UseStartup<Startup>();

Then in Startup.cs, in Configure(), I would add the middleware like this:

        app.UseWindowsAuthentication();

I then get this error: You need the connection filter installed to use windows authentication

The unit test shows that you need to add WindowsAuthentication middleware to ListenOptions in UseKestrel but that method also requires a URL/port number.

Any way to make it work while storing URL/port number in config file?

sandrakim90 avatar Jan 03 '19 19:01 sandrakim90