具有asp.net核心的Windows身份验证

编程入门 行业动态 更新时间:2024-10-22 18:48:35
本文介绍了具有asp核心的Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

请提供有关如何在ASP.NET Core RC2 +上实现Windows身份验证的指南。

Please provide guidance on how to implement Windows Authentication on ASP.NET Core RC2+.

我看到了其他描述承载身份验证的SO问题,例如使用ASP.NET Core RC2 404(而不是403)进行承载者身份验证

I see other SO questions that describe bearer authentication like Bearer Authentication with ASP.NET Core RC2 404 instead of 403

但这不是我想要的。

推荐答案

您可以使用WebListener来做到这一点,就像这样:

You can do this using WebListener, like so:

  • 打开project.json并将WebListener添加到依赖项:

  • Open your project.json and add WebListener to dependencies: "dependencies" : { ... "Microsoft.AspNetCore.Server.WebListener": "0.1.0-rc2-final" ... }

  • 添加命令的WebListener(同样在Project.json中)

  • Add WebListener to commands (again in Project.json)

    "commands": { "weblistener": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener" },

  • 在Startup.cs中,指定WebHostBuilder以将WebListener与NTLM一起使用

  • In Startup.cs, specify the WebHostBuilder to use WebListener with 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();

  • 就是这样!

    更多推荐

    具有asp.net核心的Windows身份验证

    本文发布于:2023-11-16 18:32:24,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1606768.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:身份验证   核心   asp   net   Windows

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!