Last post Jan 15, 2013 06:57 AM by Angie xu - MSFT
Jan 11, 2013 05:45 AM|prafulrk|LINK
We have an web application developed using c#(VS 2008/3.5 framework). The application uses the mode of authentication as "Windows" with a service account present in domain (Domain1) to run the application as ASP.Net user. We have authentication to be done
for the users present in different domain (Domain 2). When authentication is done using the directory services(Directory searcher), we are able to connect to LDAP of domain1 and bind it, so that user is authenticated. Also, the user is able to be authenticated
if the user has been migrated from domain1 to domain 2. However, if there is a user id directly created in domain 2, then application is not able to bind to Domain2 (during the LDAP authentication) and hence, this user is not being authenticated by the application.
Please suggest the solution regarding the same.
<identity impersonate="true" userName="domain1\svc_acc" password="***"/>
public bool ValidateUidPwdAndGetUserTypeGlobal(string TPXId, string password)
string strADPath = "LDAP://a.b.c/dc=a,dc=b,dc=c";
DirectoryEntry objDirEntry = new DirectoryEntry(strADPath, TPXId, password);
DirectorySearcher search = new DirectorySearcher(objDirEntry);
search.Filter = "(samaccountname=" + TPXId + ")";
SearchResult result = search.FindOne();
if (null == result)
catch (Exception ex)
Jan 15, 2013 06:57 AM|Angie xu - MSFT|LINK
Perhaps this thread is a good reference for you about cross domain authentication using DirectoryServices in stackoverflow.
Cross Domain Authentication using DirectoryServices
hope it helps you,