How to let my App pass firewall/proxy authentication etc

  • Thread starter Thread starter BVM
  • Start date Start date
B

BVM

Hi:

I have a problem:

I am developing a application that use web service from a web server in Internet. When user's internet port has firewall/proxy authentication things, my app cannot pass it and go to Internet. How can I make it work?

Many Thanks,

Dennis
 
Look into the System.Net.WebProxy. Of course, if the "firewall/proxy authentication things" are configured to block it, then you can't do much (that's their purpose!).
-mike
MVP
Hi:

I have a problem:

I am developing a application that use web service from a web server in Internet. When user's internet port has firewall/proxy authentication things, my app cannot pass it and go to Internet. How can I make it work?

Many Thanks,

Dennis
 
Thanks, Mike.

Is it possible to detect proxy server address and port on the run time? So I don't need to ask users to enter proxy server information because most of them just don't know.

Thanks,

Dennis

Look into the System.Net.WebProxy. Of course, if the "firewall/proxy authentication things" are configured to block it, then you can't do much (that's their purpose!).
-mike
MVP
Hi:

I have a problem:

I am developing a application that use web service from a web server in Internet. When user's internet port has firewall/proxy authentication things, my app cannot pass it and go to Internet. How can I make it work?

Many Thanks,

Dennis
 
Thanks, Roy. In the following codes from your web page, why do you need
myCache? What does "Negotiate" mean here?

========

private static void SetCredentials(WebProxy proxy,string user,string
password,string domain,string uri)
{

CredentialCache myCache = new CredentialCache();

NetworkCredential myCred =null;



if(domain==null || domain.Length==0)

{ myCred = new NetworkCredential(user,password);}

else

{myCred = new NetworkCredential(user,password,domain);}



myCache.Add(new Uri(uri), "Negotiate", myCred);

proxy.Credentials = myCred;

}



=====

Thanks,



Dennis





Roy Osherove said:
I had the same problem, so I wrote a helper class that helps you do
exactly that.
Yes, it uses the WebProxy class, but it makes the process easier.
check it out here.
http://weblogs.asp.net/rosherove/posts/34670.aspx

Regards,
Roy Osherove
www.iserializable.com
authentication things" are configured to block it, then you can't do much
(that's their purpose!).Internet. When user's internet port has firewall/proxy authentication
things, my app cannot pass it and go to Internet. How can I make it work?
 
I was under the impression that that class could grab the settings from the local computer's Internet Settings. I haven't used it, so poke around there?

-mike
MVP
Thanks, Mike.

Is it possible to detect proxy server address and port on the run time? So I don't need to ask users to enter proxy server information because most of them just don't know.

Thanks,

Dennis

Look into the System.Net.WebProxy. Of course, if the "firewall/proxy authentication things" are configured to block it, then you can't do much (that's their purpose!).
-mike
MVP
Hi:

I have a problem:

I am developing a application that use web service from a web server in Internet. When user's internet port has firewall/proxy authentication things, my app cannot pass it and go to Internet. How can I make it work?

Many Thanks,

Dennis
 
You need the CredentialCache object for the proxy to work with.
Negotiate means that when the web request will get to the proxy
server, it will "negotiate" with it, meaning "Interact" with it, so it
will answer it for user/password when asked for.
Lookup WebProxy in MSDN...
 
Back
Top