Using SQL Server 2005, how can I authenticate a username/password pair against a non-AD LDAP server using NET ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If calling from SQL Server 2005, you'll need to create a .NET stored procedure.
Using .NET to connect to LDAP:
http://msdn.microsoft.com/en-us/library/system.directoryservices.aspx
using System.DirectoryServices;
DirectoryEntry DE = new DirectoryEntry(LDAPPath, LDAP_Domain + account, password, AuthenticationTypes.Secure);
if (DE == null)
{
// Login failure
}