473,624 Members | 2,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebProxy support NTLM?

Consider accessing a webpage through a proxy server:

WebRequest request = WebRequest.Crea te("http://somepage.com");
WebProxy proxy = new WebProxy(proxyH ost, proxyPort);
proxy.Credentia ls = new NetworkCredenti al(proxyUsernam e,
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.Credentia ls = new
NetworkCredenti al(proxyUsernam e,proxyPassword ).GetCredential (proxyURI,
"NTLM");

Regards,

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

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

WebRequest request = WebRequest.Crea te("http://somepage.com");
WebProxy proxy = new WebProxy(proxyH ost, proxyPort);
proxy.Credentia ls = new NetworkCredenti al(proxyUsernam e,
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.Credentia ls = new
NetworkCredenti al(proxyUsernam e,proxyPassword ).GetCredential (proxyURI,
"NTLM");


The NetworkCredenti al covers all challenge/response schemes registered
with the AuthenticationM anager class, including NTLM. Your first code
snippet should work fine.

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
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
NetworkCredenti al(proxyUsernam e,proxyPassword ).GetCredential (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
NetworkCredenti al(proxyUsernam e,proxyPassword ).GetCredential (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.d e
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
5646
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 6? Thanks, Sam -- _______________________________ Sam Santiago ssantiago@n0spam-SoftiTechture.com
0
3669
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 using proxy servers that this doesn't work and the web service does not connect. System.Net.WebProxy proxy = System.Net.WebProxy.GetDefaultProxy(); Any suggestions on how I can get the actual proxy settings that IE is using, even if it...
1
2399
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 non-NTLM case, the user types his password into the web front end and server X passes it to Y in order to authenticate him. In the NTLM case, the user is already authenticated to X but since X does
4
3475
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 into all kinds of problems because I'm behind a firewall. After much searching I found using WebProxy, NetworkCredentials and HttpWebResponse/Request to be quite useful but again it's not really working the way I'd like. So I decided to setup a...
3
9091
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 System.Net; string proxyUrl = http://itgproxy.redmond.corp.microsoft.com; WebProxy proxy = new WebProxy(proxyUrl, true); MSNSearchService.Proxy = proxy;
1
6817
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 401 Unauthorized\r\n' header: Content-Length: 1656 header: Content-Type: text/html header: Server: Microsoft-IIS/6.0 header: WWW-Authenticate: NTLM header: X-Powered-By: ASP.NET
3
7084
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 reach server, because proxy requires NTLM Authorization before redirecting.
1
2716
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 . NTLM is a MS proprietary protocol designed so that will allow authentication only from MS browsers . This proprietary was cracked and code was written in python by
7
2975
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 message contains a link to the microsoft website, but this link just takes you to the .Net framework home page: http://go.microsoft.com/fwlink/?linkid=14202 Can anyone provide the correct link and/or please explain what should now be used instead of...
0
8246
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
8179
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
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8490
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
7174
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4184
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1489
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.