Skip to content

Is it possible to use WindowsAuthentication middleware without ListenOptions? #114

@sandrakim90

Description

@sandrakim90

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions