Sql-server – Can SQL Server OpenQuery/OpenRowSet to an LDAP Linked Server be used for Authentication

authenticationldaplinked-serveropenrowsetsql server

I can fetch data back from LDAPS (port 636/3269) by first creating a Linked Server using sp_addlinkedserver and sp_addlinkedsrvlogin.

However, what I really need to do is to authenticate a Username/Password pair against LDAPS, to determine if the credentials are Valid.

Can SQL Server be used in any way to authenticate Username/Password credentials against AD/LDAP? Is it possible to use an Extended Stored Procedure or the CLR to do this? I need to abstract this away from a .DLL because the same authentication needs to be used in a legacy application and on a website.

Best Answer

I'm not sure why you'd need a linked server to LDAP to validate credentials? SQL Server has Active Directory (Windows) authentication built into it, so you should be able to leverage that as long as you add the appropriate Login object in SQL Server for either the AD User or AD Group that user is a part of, so they have the ability to connect.

Unless I'm missing something like you're trying to connect to LDAP of a different domain than that of the SQL Server instance, but then we'd more details on your goal.