应该是windows domain自身支持的方法可以看看这个文章Integrated Windows Authentication (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/523ae943-5e6a-4200-9103-9808baa00157.mspx?mfr=true
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/523ae943-5e6a-4200-9103-9808baa00157.mspx?mfr=true
Active Directory Users Tasks
http://www.codeproject.com/Articles/18102/Howto-Almost-Everything-In-Active-Directory-via-C#35文章中还描述了AD的其它应用。
private bool Authenticate(string userName,
string password, string domain)
{
bool authentic = false;
try
{
DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,
userName, password);
object nativeObject = entry.NativeObject;
authentic = true;
}
catch (DirectoryServicesCOMException) { }
return authentic;
}这个不是认证的方法吗?虽然不一定是IIS使用的,但是它是开放给开发者调用的。
IIS 直接用Integrated authention 直接帮你做认证了,你不需要自己认证了呀。
参考:http://www.cnblogs.com/chnking/archive/2007/11/20/965553.html#_Toc183326157 中的1、 NTLM验证过程
所以我就想知道,有没有 根据(用户名、密码密文)来验证用户是否是合法用户的api。jshi123 ,你的说法不对,服务器端,是调用域认证服务器来进行验证的,它有一个根据(用户名,密码密文)验证的方法。
只是这个方法对我们不公开。
如果你想“仿冒”iis对客户端进行NTLM验证,就按照上面链接中的“1、 NTLM验证过程”中的步骤,给出和iis一样的应答报文就可以了,当然前提是你得知道客户的密码。