SQL Server LDAP authentication

2019-08-22 18:07发布

问题:

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
}