An attempt to implement an object in a test environment.
.UseWebListener(options=> { options.ListenerSettings.Authentication.Schemes = AuthenticationSchemes.NTLM | AuthenticationSchemes.Negotiate; options.ListenerSettings.Authentication.AllowAnonymous = true; })
and
app.UseWhen(context => context.Request.Path.StartsWithSegments("/ntlm"), builder => builder.UseCookieAuthentication(new CookieAuthenticationOptions() { AutomaticAuthenticate = true, AutomaticChallenge = true, LoginPath = "/Main/Login", LogoutPath = "/Main/Logout", AuthenticationScheme = "NTLM", AccessDeniedPath = "/Main/Deny" } )); app.UseWhen(context => !context.Request.Path.StartsWithSegments("/ntlm"), builder => builder.UseCookieAuthentication(new CookieAuthenticationOptions() { AutomaticAuthenticate = false, AutomaticChallenge = false, LoginPath = "/Main/Login", LogoutPath = "/Main/Logout", AuthenticationScheme = "Cookies" } ));
But it doesn't seem to make any difference whether the request starts with "/ ntlm" or not.
I tried running two WebListeners, but I think they have more overhead.
What I want to achieve: The user goes to the start page with the login form, and there is a "Windows auth" button on it. He can enter credentials or click a button and enter with the identifier of his OS.
Danil source share