473,608 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using webproxy object in 2.0 when proxy has been configured to use Active Directory

Please, if this is the incorrect forum for this question, let me know which
forum is most appropriate. I want to make sure I get visibility with the
proper gurus!

I have a .NET console app that consumes an external web service. It has
passed a userid and password to a web proxy object to pass through our
corporate proxy server and has been running fine for weeks. Our operations
staff has just changed the proxy server so that it now pulls credentials
from our Active Directory, which allows our users to not be prompted at the
firewall when using the Internet since it uses their Windows logon
credentials to authenticate. As such, a connection to an external URL is
handled by the Windows login credentials of the "currently logged in user".
Great for the users, bad for some of our apps! This has caused a few of
our server-based apps to fail, since they are logged in as system accounts.
In my particular case, since my application is doing system-to-system
processing, I have the managed to get my target web service domain on an
exclusion list so it can be accessed without passing ANY proxy credentials.
I have yet to get this to work correctly. Even on my laptop, I can only get
the code to work if I pass the DefaultNetworkC redentials property of the
CredentialCache object. If I take that line out, I get a 407 PRoxy
Authentication Required exception. On the server, it just bombs completely.
I have tried all sorts of things to try to get it to work, but on the server
it continuously fails to get thru the proxy. Here's a code snippet that I
have today which passes no credentials:

public void EstablishConnec tion()

{
// create a container for an HTTP request

req = (HttpWebRequest )WebRequest.Cre ate(GetLogInURL ());
//GetLogInURL=ext ernal address
myProxy = new System.Net.WebP roxy("000.000.0 0.000:11111", true);
myProxy.Credent ials = CredentialCache .DefaultNetwork Credentials; //this
works only on my laptop. before the AD stuff came along I was using
myProxy.Credent ials = new NetworkCredenti als("myid", "mypw") on the server
and it worked

req.Proxy = myProxy;

req.Timeout = 1000000;
// make the HTTP call

HttpWebResponse resp = (HttpWebRespons e)req.GetRespon se(); //fails here

if (resp.StatusCod e == System.Net.Http StatusCode.OK)

{

..... if the code gets here I'm OK. But it fails everytime on the server
and returns a 407 Proxy Authentication Required exception. How can I get
the code to ignore the machine that it's running on and hit our proxy
without passing any credentials?
Oct 8 '06 #1
0 2114

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

Similar topics

0
1427
by: Lee, Dustin | last post by:
I'm using python2.2.2 on redhat linux 7.3 Here's a snippet of what I'm trying to run: # set up proxy import urllib2 proxy_support = urllib2.ProxyHandler({"http":"http://webproxy.mycompany.com:3128"}) #proxy_support = urllib2.ProxyHandler() opener = urllib2.build_opener(proxy_support) urllib2.install_opener(opener)
1
4006
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code, when I get back in-house from being on the road to click a button, and select the backends I want to link to? I would want to delete all the current links and link to the "live"
4
4460
by: WATYF1 | last post by:
Hello. I'm writing a VB.NET app to check email message counts for both POP3 and IMAP4. I'm using TCPClient to connect, and a NetworkStream to send simple commands. It's a very simple bit of code, actually... the problem is, if the user is behind a proxy, then the Connect method fails (times out). How do I get around this? I thought this would be a common issue and that there would be plenty of code out there to demonstrate how to...
3
2612
by: Jay-nospam | last post by:
Hi there, I am having trouble getting an ASP.NET web application to connect to another computer and passing the proper credentials and I hope someone can help me. I have a stand-alone Windows 2003 Server, ServerA, running as a Web Server that uses ASP.NET. The default.aspx file tries to access a file in a share on another computer, ServerB. ServerA and ServerB are on the same domain and are both running Windows 2003 Server.
2
11418
by: rcp | last post by:
Hi all, I've read all posts from all existing threads and none of them worked to solve my problem, although its exactly the same. I'll try to explain my case and see if a kind soul could help me out: I've a win32 service in C# on a client machine A, which accesses a WS (C#) on a server machine B (hosted on an IIS) Case 1: If I try to add the WSDL for the WS through VS2005, the 'Discovery
0
1818
by: Maxx57 | last post by:
C# VS.Net 1.1 (2003) - trouble with using IE proxy server settings I've got a program that detects if it can connect to a webservice. It sends a System.Net.WebRequest and then checks the information it gets back to findout if it can connect to the service properly. If there is an error it will catch an exception and everything is fine. This used to work wonderfully, until somebody decided they needed to use a proxy server. (rats!) It's...
1
4994
by: =?Utf-8?B?Z2FsbGFu?= | last post by:
We have an application that is running fine on several of our customer’s servers. However, one of our customers is having a problem running the application. The application works on one of his Windows 2003 servers, but not on the other one. The application is a C++ .Net /clr Windows Service. It communicates with our server by sending and receiving XML using the WebClient object. The error they are receiving is “The remote server...
3
4209
by: =?Utf-8?B?TXJOb2JvZHk=?= | last post by:
I found an example online and when I tried repeating it with the proxy I normally use for my browser, I get errors. What I do is this: WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true); That url is exactly what I enter into Firefox advanced settings to get beyond the office firewall here, but C# does not like it.
2
8152
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with 407 Proxy Authentication Required. The same request through the old proxy succeeds. The same request to an HTTP address through the new proxy succeeds. Also, the request succeeds when forced to use Basic authentication but fails on NTLM.
0
8050
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7987
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8464
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8130
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8324
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4015
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2464
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.