473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

using integrated NT security for an http post through a proxy serv

Hello,

We have a C#.NET app which runs as a windows service. Periodically it needs
to post information via the internet to a remote server.

For the posting, we are using HttpWebRequest class.

This service gets deployed to customer machines. In cases where they use a
proxy server, they complained that our service did not respect the proxy
settings they entered via Internet Explorer. In an earlier post to this
newsgroup, someone pointed out that the IE proxy settings are per user, and
that could be my problem. As it turned out, that was half the problem. We
not only had to run the service as the same user which had IE proxy settings,
but we also had to explicitly set the proxy settings of our HttpWebRequest to
those of IE, like this:

webRequest.Proxy = WebProxy.GetDefaultProxy();

That did work and it caused our service to begin using the IE proxy setting.

However, now the problem is authentication. Our web request is hitting the
proxy as an anonymous request, rather than using the integrated NT security
for the user under which it is running.

I can't find any documentation that tells me how to set my authentication to
use the integrated NT security. I did find sample code which shows how to
set the user/passwd of the proxy call to some strings, but that won't work in
cases where the proxy is trying to use integrated NT security.

Can anyone tell me how to achieve this?

thanks
Robb
Nov 22 '05 #1
3 2131
Hi Robb,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know how to get the
credential of the current app and pass it to the Webproxy object. If there
is any misunderstanding, please feel free to let me know.

As far as I know, if you have run the windows service under a certain
account, you can get the credential using the
CredentialCache.DefaultCredentials property. Then you just assign it to the
Webproxy object's Credentials property like the following.

webRequest.Proxy.Credentials =
System.Net.CredentialCache.DefaultCredentials;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #2
Thank you Kevin, that was what I needed, that worked great!

-Robb

"Kevin Yu [MSFT]" wrote:
Hi Robb,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know how to get the
credential of the current app and pass it to the Webproxy object. If there
is any misunderstanding, please feel free to let me know.

As far as I know, if you have run the windows service under a certain
account, you can get the credential using the
CredentialCache.DefaultCredentials property. Then you just assign it to the
Webproxy object's Credentials property like the following.

webRequest.Proxy.Credentials =
System.Net.CredentialCache.DefaultCredentials;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #3
You're welcome, Robb.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Guy Incognito | last post by:
Hello, I'm having a problem adding integrated security to an asp.net web application. IIS runs on server A and SQL server runs on server B. The folder containing the web application is set to...
1
by: Tilted | last post by:
Hi I have an application which has been deployed and worked fine on all previous workstations, it is c# based and uses Crystal connecting directly to MSDE using stored procedures and the...
6
by: Marina | last post by:
Hi, I would like to give the ASPNET process that is running on my machine permission to connect to a sql server database that is on another machine. When I try to do this it says: 'Windows NT user...
1
by: Brian | last post by:
Is there any update as to whether or not impersonation can be used with SQL session state when using integrated security? Are there any work arounds? For example giving the impersonation account...
2
by: Bob | last post by:
I would like to use integrated security for DB connection for my ASP.NET applications. Since these apps have different databases (SQL Server), I want each app to be able to access its own...
1
by: martin | last post by:
Hi I have ingrated security turned on in IIS and the following element in web.config <identity impersonate="true"/> This configuration works great on my development machine, as soon as I...
1
by: et | last post by:
I created a web site using integrated security, and now I want it taken off. I have taken it off of everything in IIS, I have even re-created the project, brand new, nothing is in the project but...
0
by: jens Jensen | last post by:
Hello, I need to write a webservice that will authenticate via x509. The problem here is , i will configure it not to use SOAP. Just use http post. How can i add x509 authentication? ...
2
by: Hellotalktome13 | last post by:
Using a simple ASP.net page with a crystal report on it. Loading from IIS using Integrated Secruity in the reports connection string it populates the report in the browser. What User ID and...
0
by: jacorona | last post by:
Hello all, I have found a problem accesing a web service hosted in IIS 5.0 in a W2K box. The web service site is configured to accept both integrated windows authentication and client certificates....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.