如何在 ASP.Net 中对 Kerberos (Apple Open Directory) 服务器进行身份验证
在工作中,我们刚刚实现了一个 Apple Open Directory 服务器。它存储每个人的用户名和密码并实现 LDAP 和 Kerberos。我的任务是配置我们所有的 ASP.Net Web 应用程序以进行身份验证,以便用户可以使用他们的 Open Directory 用户名和密码登录我们的 ASP.Net 应用程序。
我需要类似 mod_auth_kerb 的东西,除了 IIS 和 ASP.Net,而且我想使用基于表单的身份验证。
这可能吗?
Here at work we just implemented an Apple Open Directory server. It stores everyone's usernames and passwords and implements LDAP and Kerberos. I've been tasked with configuring all of our ASP.Net web applications to authenticate with it--so users can use their Open Directory usernames and passwords to log into our ASP.Net applications.
I need something like mod_auth_kerb, except for IIS and ASP.Net--and I'd like to use forms-based authentication.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,IIS 仅支持 Kerberos 进行 NTLM 身份验证。我从未见过支持 kerberos 的辅助库或软件。 (我的意思是真正的 kerberos)现在您可以使用 .Net 中的 LDAP 库以 kerberos 方式在服务器之间进行通信,但用户客户端和 asp.net 服务器之间的连接仍然是 SSL 纯文本/文本连接。
我也从未见过它完成,但它应该能够完成...如果 asp.net 服务器与 Apple Open Directory 服务器具有信任关系,并在两者之间建立 LDAP 连接,则可能可以在 IIS 级别启用 NTLM 身份验证,这将(理论上)通过信任将 kerberos 连接扩展到 AOD。再说一次,我从来没有考虑过它,所以我不知道尝试它会遇到什么陷阱。
我已成功使用 DirectoryServices 通过 LDAP 协议连接到其他 Active Directory,但我仍然没有找到一种在客户端和身份验证服务器之间嵌入 kerberos 连接而无需 NTLM 的方法。
IIS only supports kerberos for NTLM authentication as far as I know. I have never seen a secondary kerberos capable library or software. (true kerberos I mean) Now you could use the LDAP libraries in .Net to communicate between the servers in a kerberos fashion, but the connection between user client and asp.net server would still be an SSL plain/text connection.
I've also never seen it done, but it should be able to be done ... if the asp.net server had a trust relationship with the Apple Open Directory server with an LDAP connection made between the two, it might be possible to enable the NTLM authentication at the IIS level, and that would (in theory) extend the kerberos connectivity to the AOD through the trust. Again, I've never even contemplated it so I don't know what the pitfalls would be of attempting it.
I have successfully used DirectoryServices to connect to other Active Directories through the LDAP protocol, but I still have not found a way to embed the kerberos connectivity between client and authentication server without NTLM.
要在 IIS 中使用 Kerberos 身份验证,受保护资源的身份验证类型应为“Windows 身份验证”。这将使 IIS 使用协商 (spnego) 身份验证。服务器必须是 Kerberos 才能工作的域的成员。如果可能的话,我建议使用 Server 2008 或 Server 2008 R2 计算机来执行此操作,因为它可以更优雅地处理 Kerberos 身份验证。
我已经有一段时间没有机会使用 Mac 服务器了,但据我了解,Open Directory 能够为 Windows 域成员提供服务。对于授权,您必须从 ASP 查询 LDAP 目录或使用您自己的内部授权机制。
编辑:这篇 Microsoft 知识库文章可能对您有用: http:// msdn.microsoft.com/en-us/library/aa480475.aspx
To use Kerberos authentication in IIS, your authentication type for the protected resource should be "Windows Authentication". This will make IIS use Negotiate (spnego) authentication. The server must be a member of a domain for Kerberos to work. I'd recommend using a Server 2008 or Server 2008 R2 machine for this if possible as it handles Kerberos authentication more gracefully.
I haven't gotten a chance to work with a Mac server for a while, but It's my understanding that Open Directory is capable of serving a Windows domain member. For authorization, you'll have to query the LDAP directory from ASP or use your own internal authorization mechanism.
Edit: This Microsoft KB article might be of some use to you: http://msdn.microsoft.com/en-us/library/aa480475.aspx