基于请求的ASP Net Core 2.0身份验证

时间:2018-07-23 14:07:55

标签: c# authentication asp.net-core

我们已根据建议https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-2.1&tabs=aspnetcore2x

使用HttpSys实现(没有IIS)使用Windows身份验证配置了ASP Net。
services.AddAuthentication(HttpSysDefaults.AuthenticationScheme);

.UseHttpSys(options =>
                                {
                                    options.Authentication.Schemes = AuthenticationSchemes.NTLM | AuthenticationSchemes.Negotiate;
                                    options.Authentication.AllowAnonymous = false;
                                })

我们想要实现的是忽略具有特定查询参数(?Anonymous)的所有请求的NTLM质询401-客户端可以控制的开关,只是传递匿名用户,有效地关闭了Windows身份验证。 我已经尝试过遵循https://github.com/aspnet/Security/issues/1469上的建议,推出自己的IAuthenticationHandlerProvider,IAuthenticationHandler实现,但这并不能阻止NTLM挑战

我还尝试将HttpSys设置为允许匿名

options.Authentication.AllowAnonymous = true;

但这只是关闭了NTLM的全球挑战

有什么想法吗?

关于, 斯蒂芬

0 个答案:

没有答案