Re: Error using LDAP - An Operation Error occured



Guess you have a security issue due to the multi-hop architecture
(clientmachine-webserver-LDAP server), one way to solve this is by
specifying fixed explicit credentials (see DirectoryEntry overload that
takes credentials) when binding to the LDA server. For security sake, store
the (encrypted)credentials in a safe place and use role based security to
control access to the LDAP.
Another (and more secure) option is to move this code to COM+ as a server
type apllication that runs with fixed credentials, here again you can apply
roles to implement fine-grained security access control and auditing.

Willy.

"Jay" <jaymehta18@xxxxxxxxx> wrote in message
news:1154585186.880694.255640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Hi,
|
| This is Jay Mehta. I have this problem when using LDAP. I extract names
| and EmailId's of all those present from LDAP and populate in a
| datagrid.
|
| Now when run locally, it is running properly. But when put on Web
| Server and try to access it from client machines, it is giving the
| Error as "An Operation Error Occured".
|
| It is running properly even when running on webserver directly. But
| only while accessing from Client Machines it is throwing that
| Exception.
|
| The code i am using is:
|
| System.DirectoryServices.DirectoryEntry root = new
| System.DirectoryServices.DirectoryEntry("LDAP://dc="Domainname",dc=com";);
|
| System.DirectoryServices.DirectorySearcher oSearcher = new
| System.DirectoryServices.DirectorySearcher(root);
|
| oSearcher.ReferralChasing =
| System.DirectoryServices.ReferralChasingOption.All;
|
| oSearcher.PropertiesToLoad.Add("mail");
| oSearcher.PropertiesToLoad.Add("Name");
| int count=0;
| oSearcher.Filter = "(&(objectcategory=user)(mail=*))";
| System.DirectoryServices.SearchResultCollection oResult = null;
| try
| {
| oResult = oSearcher.FindAll();
| foreach(SearchResult osearchres in oResult)
| {
| try
| {
| DataRow dr;
| dr=ds.Tables[0].NewRow();
| dr["Email"] = osearchres.Properties["mail"][0].ToString();
| dr["Name"] = osearchres.Properties["name"][0].ToString();
| dt.Rows.Add(dr);
| count=count+1;
| }
| catch(Exception aExc)
| {
| throw aExc;
| }
| }
| DataGrid1.DataSource=ds;
| DataGrid1.DataBind();
| DataGrid1.Visible=true;
| Session["ActiveDirectoryListing"]=ds;
| }
| catch(Exception aExc)
| {
| throw aExc;
| }
|
|
|
| Just want to know if there are any security setting that needs to be
| done on webserver.
|
| Any help would be highly appreciated.
|
| Thanks,
| Jay
|


.



Relevant Pages

  • Re: UnauthorizedAccessException when using MSDTC
    ... dispatcher2 is the user logged on the client pc. ... Event Source: Security ... Object Server: SC Manager ... Primary Domain: BLITZ ...
    (microsoft.public.data.ado)
  • Re: Routing and Remote Access - Authentication Failure
    ... because the real client computer can tunel through it's local NAT router, ... travel the Intrenet, join the VPN and access the server, when this feature ... Their security system decided that the server was trying to steel ...
    (microsoft.public.windows.server.networking)
  • Re: WCF security advice (and clarification) needed
    ... You, the client, resolve the foo.mycompany.com hostname within your ... TCP/IP) with that ticket as the security token. ... There are two parties participating in a security scenario, the server ... HTTP supports other authentication ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Problems with security requirements in Windows WorkGroups.
    ... "A remote side security requirement was not fulfilled during authentication. ... small chat application between a client and a server ... When I try to use the TCP channel I get the error (with NO inner exception ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: VPN -- the next consumer "turnkey"?
    ... I'm not a security expert. ... "A Hamachi system is comprised of backend servers and end-node ... Server nodes track client's locations and provide ... services without providing Hamachi with a list of client IP's. ...
    (alt.internet.wireless)