使用自定义 (asp.net) 表单的 NTLM 身份验证
是否可以使用 NTLM(在 asp.net 上)以编程方式对用户进行身份验证?
我想控制网站的外观和感觉,我将有一个用户输入用户名/密码的表单。然后我会查询 NTLM 以验证提供的信息,如果有效,请将它们重定向到虚拟目录?
Is it possible to programatically authenticate a user using NTLM (on asp.net)?
I would like to have control over the look and feel of the website where I would have a form that users enter their username/password. I would then query NTLM to validate the provided information and if valid, redirect them to a virtual directory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NTLM 是 Web 浏览器直接与 Web 服务器(例如 IIS)对话以验证用户身份的协议,而不涉及您的应用程序。这就是您想要避免的,因为您想要呈现一个“漂亮”的登录表单。
因此,您需要做的是:在表单中提示输入用户名和密码,并自行根据 Active Directory 验证这些凭据。下面是一篇 Microsoft 文章,介绍了如何在 ASP.NET 中执行此操作:http://support。 microsoft.com/kb/326340/en-us
但是请记住几点:
NTLM is the protocol the web browser would talk directly to the web server (e. g. IIS) to authenticate the user, without your application being involved. That's what you want to avoid, because you want to present a "nice" logon form.
So what you need to do is: prompt for user name and password in a form, and validate these credentials against Active Directory yourself. Here is a Microsoft article describing how to do it in ASP.NET: http://support.microsoft.com/kb/326340/en-us
However please remember a few points: