Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 28, 2005 07:42 PM by dunnry
Jun 28, 2005 02:54 PM|LINK
I have created a web application that reads from the active directory (using a DirectorySearcher object) to populate certain field on the form. When I request the page from the browser on the machine where the web server is installed
,my code executes fine and the fields are populated correctly. The trouble is when I request the page using another machine, the web server returns a thrown exception ( Com execption) raised by either FindOne() or FindAll() method of the DirectorySearcher
Now, in my code, the DirectorySearcher is initiated and it's
SearchRoot property is pointing to a DirectoryEntry object I initiated before, which defines the
Path property only ( no User not
Password is used because I am using Windows authentication so I don't capture the user credentials apart from the username). Therefore the
Searcher fails to log on to the AD to carry out the search.
In another scenario, I have supplied a valid user name and password for the DirectoryEntry object and the page was successfully returned to the user.
My aim is to not use any hardcoded username/password in any file nor in the registry and I do want the user to log on via a logon page as I am using windows authentication.
To summarise: Why DirectorySearcher successfuly logs on to the AD when the page is requested from the same machine as the web server, and fails to do so when the page is requested from another machine?
Notes to Add:
I am using Windows Authentication and Impersonnation is set to true and also the
is emitted in my assembly. ( this was added in my Assembly.cs file and checked in the resulting assembly using idasm tool)
Any help, comments would be highly appreciated.
Jun 28, 2005 07:42 PM|LINK
There is a new post now that discusses your options in this regard:
See if this helps. If you have more questions, post back.