Passing AD authentication credentials via IE browser in C# Windows Form

10,113

Under what Internet Zone does the website you are pointing to run under? Even if you are using your own browser control, it will still be in some zone. Determine what zone it is by using a normal browser to go to the relevant site, and determine what zone it is in.
alt text http://img219.imageshack.us/img219/7162/internetzonenp8.jpg

If that specific zone has the automatically log in, it will take your logged on credentials. If however you are not logged on as a valid domain user, then those local windows credentials are not accepted, and it seems to fall back on your code supplied credentials. alt text http://img230.imageshack.us/img230/407/settingskm3.jpg

If security is not a big concern, perhaps it makes sense to run your existing web page under an application pool, running under the service account credentials. Remember to add the service account to the worker process group, and take the integrated authentication feature off.

I have from past experienced learn that is generally is more robust, and maintainable by adding a global group into a local group, and perhaps giving that local group permission on the server. But the real world is sometimes messy and that is certainly not always practical or the best solution.

I hope that this answers some of your questions, but I dont think it will answer all of it. If there is a spesific area that you would like more info and if I can answer it, I would be glad to help.

Best Regards Rihan

Share:
10,113
user3488101
Author by

user3488101

Updated on June 05, 2022

Comments

  • user3488101
    user3488101 almost 2 years

    We have a Windows Form application which hosts an IE browser control. Our users run the application and open links to documents stored in MOSS. We are trying to set the application up to pass in credentials of a service account so that we can avoid giving all users access to the MOSS site. We have used code found here which seems to work fine if the user is not currently signed on to our domain. However the application will not seem to pass in the service account authentication for any user which is already authenticated to the domain. In this case it just seems to use the authenticated users credentials.

    How can we make this work?