Trying to implement subject 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 seems there`s no difference, whether request path starts with "/ntlm" or not.
I tried running two WebListeners, but I think there`s much more overhead.
What I want to achieve: User gets on start page with login form and there`s a "Windows auth" button on it. He can enter credentials or press the button and go in with his OS identity.