Click here to Skip to main content
15,901,035 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Access Error Pin
Meax25-Sep-06 19:33
Meax25-Sep-06 19:33 
AnswerRe: Access Error Pin
M LN Rao25-Sep-06 19:33
M LN Rao25-Sep-06 19:33 
QuestionHot to convert Web.sitemap to Google site map? Pin
shapper25-Sep-06 15:31
shapper25-Sep-06 15:31 
QuestionHow to make a SiteMapDataSource to use a SiteMapProvider defined in Web.Config? Pin
shapper25-Sep-06 15:24
shapper25-Sep-06 15:24 
AnswerRe: How to make a SiteMapDataSource to use a SiteMapProvider defined in Web.Config? Pin
minhpc_bk25-Sep-06 19:53
minhpc_bk25-Sep-06 19:53 
AnswerRe: How to make a SiteMapDataSource to use a SiteMapProvider defined in Web.Config? Pin
Bishoy Labib26-Sep-06 12:41
Bishoy Labib26-Sep-06 12:41 
Questionupload component Pin
haytham_mohammad25-Sep-06 13:29
haytham_mohammad25-Sep-06 13:29 
Questionuser validation throug active directory (LDAP) Pin
machocr25-Sep-06 13:20
machocr25-Sep-06 13:20 
Hi, I need to validate users throug active directory in asp.net 2.0.
The users will be on diferents locations and dommains. The users aer part of differents companies with differents dommains, so for a single user I need to search the company at database and load the company settings to be able to do the authentication by active directory.

Is that possible?
Which active directory settings do I need to store for each company?
How can I do that validation?
I have the following snippept:

1. public bool AuthenticateUser(string domain, string username, string
2. password)
3. {
4. string domainAndUsername = domain + @"\" + username;
5. DirectoryEntry entry = new DirectoryEntry( LDAPPATH,
6. domainAndUsername,
7. password);
8. try
9. {
10. // Bind to the native AdsObject to force authentication.
11. Object obj = entry.NativeObject;
12. DirectorySearcher search = new DirectorySearcher(entry);
13. search.Filter = "(SAMAccountName=" + username + ")";
14. search.PropertiesToLoad.Add("cn");
15. SearchResult result = search.FindOne();
16. if(null == result)
17. {
18. return false;
19. }
20. // Update the new path to the user in the directory
21. LDAPPATH = result.Path;
22. }
23. catch (Exception ex)
24. {
25. throw new Exception("Error authenticating user.” + ex.Message);
26. }
27. return true;
28. }


Is the code I need? can you explain me how to contruct LDAPPATH?

Thank you I'm very newie with AD.Confused | :confused:



La realidad no es más que impulsos eléctricos del cerebro - Morpheus

AnswerRe: user validation throug active directory (LDAP) Pin
minhpc_bk25-Sep-06 19:47
minhpc_bk25-Sep-06 19:47 
GeneralRe: user validation throug active directory (LDAP) Pin
machocr26-Sep-06 9:58
machocr26-Sep-06 9:58 
QuestionHow to filter nodes in SiteMapDataSource Pin
shapper25-Sep-06 11:09
shapper25-Sep-06 11:09 
AnswerRepeat question... Pin
leckey25-Sep-06 15:53
leckey25-Sep-06 15:53 
QuestionSite Map Provider Pin
shapper25-Sep-06 11:06
shapper25-Sep-06 11:06 
AnswerRe: Site Map Provider Pin
Bishoy Labib26-Sep-06 12:43
Bishoy Labib26-Sep-06 12:43 
QuestionHow to export a detailsview to excell Pin
galatia25-Sep-06 10:55
galatia25-Sep-06 10:55 
QuestionImageButton1_Click call a pop-up??? Pin
code-frog25-Sep-06 8:55
professionalcode-frog25-Sep-06 8:55 
AnswerRe: ImageButton1_Click call a pop-up??? Pin
Not Active25-Sep-06 8:59
mentorNot Active25-Sep-06 8:59 
GeneralRe: ImageButton1_Click call a pop-up??? Pin
code-frog25-Sep-06 19:57
professionalcode-frog25-Sep-06 19:57 
QuestionCustom Memberships Pin
cisco210325-Sep-06 7:49
cisco210325-Sep-06 7:49 
AnswerRe: Custom Memberships Pin
Bishoy Labib25-Sep-06 8:55
Bishoy Labib25-Sep-06 8:55 
QuestionRestrict access to resource on the site. Pin
stanwar25-Sep-06 7:29
stanwar25-Sep-06 7:29 
AnswerRe: Restrict access to resource on the site. Pin
Viral Upadhyay25-Sep-06 8:03
Viral Upadhyay25-Sep-06 8:03 
GeneralRe: Restrict access to resource on the site. Pin
cisco210325-Sep-06 8:29
cisco210325-Sep-06 8:29 
GeneralRe: Restrict access to resource on the site. Pin
stanwar25-Sep-06 9:31
stanwar25-Sep-06 9:31 
QuestionLiberary management in vb.net 1.1 asp.net Pin
amaneet25-Sep-06 7:19
amaneet25-Sep-06 7:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.