Jig*_*gar 9 .net-core asp.net-core
请提供有关如何在ASP.NET Core RC2 +上实现Windows身份验证的指导.
我看到其他SO问题描述了承载身份验证,例如使用ASP.NET Core RC2 404而不是403的承载身份验证
但这不是我想要的.
您可以使用WebListener执行此操作,如下所示:
打开project.json并将WebListener添加到依赖项:
"dependencies" : {
...
"Microsoft.AspNetCore.Server.WebListener": "0.1.0-rc2-final"
...
}
Run Code Online (Sandbox Code Playgroud)将WebListener添加到命令(再次在Project.json中)
"commands": {
"weblistener": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener"
},
Run Code Online (Sandbox Code Playgroud)在Startup.cs中,指定WebHostBuilder以将WebListener与NTLM一起使用
var host = new WebHostBuilder()
// Some configuration
.UseWebListener(options => options.Listener.AuthenticationManager.AuthenticationSchemes = AuthenticationSchemes.NTLM)
// Also UseUrls() is mandatory if no configuration is used
.Build();
Run Code Online (Sandbox Code Playgroud)而已!
| 归档时间: |
|
| 查看次数: |
20476 次 |
| 最近记录: |