I need to use Active Directory to authenticate users on my website. Our development group is telling me to use code like this:
using System.DirectoryServices.ActiveDirectory;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LdapAuthentication objAuthenticate;
I was able to add the DirectoryServices.dll to my bin directory and I added the assembly to my web.config but the LdapAuthentication type is not in System.Directory.ActiveDirectory. It says The type or namespace name ‘LdapAuthentication’ could not be found… Can anyone tell me what I’m doing wrong? Thanks.
Why do you assume it should be there? LdapAuthentication is not a type that is available in the .Net framework. I did come across this howto page where they describe to build such a class, however.