[Mono-list] Accessing .Net WebServices hiding behind NTLM authentication?

Magnus Therning magnus at therning.org
Tue May 31 18:35:59 EDT 2005

On Sat, May 28, 2005 at 01:44:00AM -0400, Gonzalo Paniagua Javier wrote:
>On Fri, 2005-05-27 at 22:57 +0100, Magnus Therning wrote:
>> My first post to this list. :-)
>> My setup:
>>  Linux machine with mono 1.0 where I run my client.
>>  Windows machine with a web service running on .Net. Accessing the web
>>  service requires NTLM authentication (HTTP way).
>> I've managed to find a proxy that can handle the NTLM authentication for
>> HTTP, but I can't get mono to use it as a proxy (adding
>> proxyaddress="localhost:5865" and bypassonlocalhost="false" doesn't
>> work). I know the proxy works (verified with wget downloading the WSDL
>> for the service :-).
>> I've written a few test clients for other web services, that aren't
>> hidden behind NTLM, so I'm confident my code is OK.
>> My questions:
>>  Is there some other (better?) way of handling the silly NTLM
>>  authentication? (Turning it off is not an option, unfortunately!)
>We support NTLM authentication in HttpWebRequest. You should not need to
>use that proxy.

The following code cuts the mustard in .Net 1.1, however it doesn't
compile in Mono1.0 (Ubuntu Hoary packaged):

 using System;
 using System.Net;
 class NTLMClient {
     public static void Main(string [] argv) {
         NTLMAuthSvc service = new NTLMAuthSvc();
         server.PreAuthenticate = true;
         server.Credentials = new NetworkCredential("username", "password", "domain");
         string res = service.Ping();

There is no service.PreAuthenticate and no service.Credentials it seems.
Do I need Mono1.1?


Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

I should be able to whisper something in your ear, even if your ear is
1000 miles away, and the government disagrees with that. GQ [magazine
in England] quoted me on that -- they changed one letter. It said I
should be able to whisper something in your *car*, even though I am
1000 miles away. I wonder what the people in England think of me.
      -- Philip Zimmermann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://galactus.ximian.com/pipermail/mono-list/attachments/20050531/95973807/attachment.bin

More information about the Mono-list mailing list