473,401 Members | 2,127 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,401 software developers and data experts.

WebProxy support NTLM?

Consider accessing a webpage through a proxy server:

WebRequest request = WebRequest.Create("http://somepage.com");
WebProxy proxy = new WebProxy(proxyHost, proxyPort);
proxy.Credentials = new NetworkCredential(proxyUsername,
proxyPassword);
request.Proxy = proxy;

Now suppose the *proxy server* authenticates using NTLM (somepage.com
does NOT require any authentication its just a webpage). How does one
tell the WebProxy object to use NTLM?

I have tried the following not expecting much and it didnt do much:

proxy.Credentials = new
NetworkCredential(proxyUsername,proxyPassword).Get Credential(proxyURI,
"NTLM");

Regards,

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
4 13325
vooose wrote:
Consider accessing a webpage through a proxy server:

WebRequest request = WebRequest.Create("http://somepage.com");
WebProxy proxy = new WebProxy(proxyHost, proxyPort);
proxy.Credentials = new NetworkCredential(proxyUsername,
proxyPassword);
request.Proxy = proxy;

Now suppose the *proxy server* authenticates using NTLM (somepage.com
does NOT require any authentication its just a webpage). How does one
tell the WebProxy object to use NTLM?

I have tried the following not expecting much and it didnt do much:

proxy.Credentials = new
NetworkCredential(proxyUsername,proxyPassword).Get Credential(proxyURI,
"NTLM");


The NetworkCredential covers all challenge/response schemes registered
with the AuthenticationManager class, including NTLM. Your first code
snippet should work fine.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 21 '05 #2
Thanks for your reply.

Now I have a slightly different question. Suppose you were using a
non-HTTP protocol but were still required to authenticate with the NTLM
proxy - something like the following would be good:

TCPClient client = new TCPClient(..);
client .Credentials = new
NetworkCredential(proxyUsername,proxyPassword).Get Credential(proxyURI,"N
TLM");

Doing this for "Basic" authentication is easy, because you just
construct a simple statement to write to the network stream (for the
proxy). However with NTLM its more involved and besides its already
been done! (for HTTP)

I would have thought there were a million and one applications that
require authentication via NTLM that *DON'T* user HTTP-style protocols
on top of TCP. I can't find much!

Regards

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 23 '05 #3
vooose wrote:
Thanks for your reply.

Now I have a slightly different question. Suppose you were using a
non-HTTP protocol but were still required to authenticate with the
NTLM proxy - something like the following would be good:

TCPClient client = new TCPClient(..);
client .Credentials = new
NetworkCredential(proxyUsername,proxyPassword).Get Credential(proxyURI,
"N TLM");

Doing this for "Basic" authentication is easy, because you just
construct a simple statement to write to the network stream (for the
proxy). However with NTLM its more involved and besides its already
been done! (for HTTP)
You might want to check out Keith Brown's .NET Developer's Guide to
Windows Security. I'm afraid I'm not a great help here.
I would have thought there were a million and one applications that
require authentication via NTLM that DON'T user HTTP-style protocols
on top of TCP. I can't find much!


Don't forget that HTTP is ubiquitous, whereas a million and one
applications implementing their own application protocol are all
oddities ;-)

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 23 '05 #4
Thanks for the heads up. I will check out Mr Brown

--
Wal
http://www.vooose.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 23 '05 #5

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

Similar topics

2
by: Sam Santiago | last post by:
I am using the WebProxy.GetDefaultProxy() function to read the IE settings, but it's returning an empty WebProxy object. Are there any known reasons why this is not reading the proxy settings in IE...
0
by: Michael S. Scherotter | last post by:
I am building a C# desktop application in .Net 1.1 that consumes web services. I use System.Net.WebProxy.GetDefaultProxy() to get the proxy settings from IE but I get reports from people who are...
1
by: Andy Fish | last post by:
Hi, I have an asp.net application in several tiers and I would like to enable it for NTLM. Say the web front end is running on server X and the business logic is running on server Y. In the...
4
by: Andrew | last post by:
Morning everybody, I have an XML document located on a web address and I wish to create a C# program to read that XML document and process it - which shouldn't be that difficult yet I'm running...
3
by: John A Grandy | last post by:
I am always RAS'd into MS CorpNet VPN under my REDMOND account. I am always able to ping "itgproxy.redmond.corp.microsoft.com" I instantiate a System.Net.WebProxy object as follows: using...
1
by: robert | last post by:
In a DAV scheme with PROPFIND or GET (PROPFIND /test/ HTTP/1.1) and Basic AUTH to a MS SharePoint over https server (AUTH required), he responds 'WWW-Authenticate: NTLM' only: reply: 'HTTP/1.1...
3
by: George Vasiliou | last post by:
Hi to all, I have made up a small client / server application with WinSock (port 443) at VB6. I have install server in my Home, and client is running behind a proxy server. Client cannot...
1
by: pycraze | last post by:
Hi , I am working on NTLM (Windows NT Lan Manager )APS (Authentication Proxy Server ) , to port to C language . I am using ethereal to monitor the packets sent between client and server ....
7
by: Phil | last post by:
According to the help this method is obsolete, but there is no hint as to what to use now instead. It does seem to work for me, although I get a warning error from the compiler. The warning...
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:
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.