views:

341

answers:

1

Using SQL Server 2005, how can I authenticate a username/password pair against a non-AD LDAP server using NET ?

A: 

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
}
Darryl Peterson
Hi Darryl,Unfortunately, the System.Directory set of assemblies/services aren't available to SQL via the CLR services.
Alex Waddell
You can access the assembly, but it considered an "Unsupported Library". I've included a couple of URLs about this.http://dbaspot.com/forums/ms-sqlserver/218655-system-directoryservices-allowable-clr.htmlhttp://msdn.microsoft.com/en-us/library/ms403279.aspx
Darryl Peterson