You must Sign In to post a response.
Category: ASP.NET
#767233
HI,
Please try this code once you get the user name and pwd of user from Log in Form:
Please find some of the details and source code:
http://www.dotnetgallery.com/kb/resource6-Login-authentication-using-LDAP-Active-Directory-for-ASPNET-applications.aspx
Please try this code once you get the user name and pwd of user from Log in Form:
using System.DirectoryServices;
public static string IsUserValid()
{
string szReturnMsg="";
try
{
LdapConnection ldp = new LdapConnection
(new LdapDirectoryIdentifier((string)null, false, false));
NetworkCredential userInfo = new NetworkCredential(Environment.UserName,
"UserPassword", Environment.UserDomainName);
ldp.Credential = userInfo;
ldp.AuthType = AuthType.Negotiate;
ldp.Bind(userInfo);
szReturnMsg="User Successfully validated!"
}
catch (LdapException ex)
{
szReturnMsg = ex.Message();
}
return szReturnMsg;
}
Please find some of the details and source code:
http://www.dotnetgallery.com/kb/resource6-Login-authentication-using-LDAP-Active-Directory-for-ASPNET-applications.aspx
Return to Return to Discussion Forum