IIS使用LDAP基本身份验证 [英] IIS basic authentication using LDAP
问题描述
我有需要使用HTTP验证与IIS的Web服务。唯一的障碍是用户的凭据是LDAP。是否有IIS配置为使用LDAP凭证为它的基本身份验证的方法吗?我以为我可以在默认域或领域设置为LDAP连接字符串的一部分,但还没有任何运气。
谢谢,
I have a web service which needs to use HTTP authentication with IIS. The only hurdle is that the user's credentials are in LDAP. Is there a way to configure IIS to use LDAP credentials for it's basic authentication? I thought I could set the default domain or realm to part of the LDAP connection string, but haven't had any luck. Thanks,
- 将会
推荐答案
我会做什么(我假设你使用的是第三方LDAP,并没有一个建在这样的方式,我还没有检查)设置 MADAM 并实现自定义的 IUserSecurityAuthority
延长 Madam.UserSecurityAuthorityBase
来检查凭据对LDAP。
What I would do (I'm assuming you're using a third party LDAP, and that there isn't a built in way of doing this; I haven't checked) is set up MADAM and implement a custom IUserSecurityAuthority
by extending Madam.UserSecurityAuthorityBase
to check the credentials against LDAP.
所有你需要做的就是覆盖了一把方法从LDAP进行身份验证。如果你碰巧使用窗体身份验证的LDAP成员资格提供程序,您可以跳过实现一个单独并使用 MembershipSecurityAuthority
包含MADAM的例子。
All you will have to do is override a handful of methods to authenticate from LDAP. If you happen to be using an LDAP Membership Provider for forms authentication, you can skip implementing that separately and use the example MembershipSecurityAuthority
included with MADAM.
从该示例文件在这里摘录:
Excerpt from that example file here:
protected override bool ValidateUser(string userName, string password)
{
return MembershipProvider.ValidateUser(userName, password);
}
这篇关于IIS使用LDAP基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!