Last post Dec 13, 2012 04:03 AM by Angie xu - MSFT
Dec 04, 2012 09:18 AM|thanjaipvr|LINK
I have requirement to authenticate my web application using LDAP Authentication against Lotus Notes(Not Active Directory).
Besides get list of user from LDAP. I am able to get list of users from LDAP using following class
But I don't know how to authenticate user with LDAP Password. I am able to validate only user id.
whether password can be taken?
How to find what encryption they have used.
Kindly guide me on the same.
many suggest following code, but it is not validating the users' password rather it does only user alone. Password given in the code is used for binding with LDAP Directory.
public bool IsAuthenticated(string domain, string username, string pwd)
string domainAndUsername = domain + @"\" + username;
DirectoryEntry entry = new DirectoryEntry(_path, domainAndUsername, pwd);
//Bind to the native AdsObject to force authentication.
object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + username + ")";
SearchResult result = search.FindOne();
if(null == result)
//Update the new path to the user in the directory.
_path = result.Path;
_filterAttribute = (string)result.Properties["cn"];
catch (Exception ex)
throw new Exception("Error authenticating user. " + ex.Message);
Dec 13, 2012 04:03 AM|Angie xu - MSFT|LINK
Please refer the link below, and check whether helpful to LDAP password authenticate,
Using LDAP for Password Authentication-
hope it helpful to you.