I remembered something. Last year someone changed proxy server with a new
linux-whatever-he-didn't-know-exactly-what-was-being-madeŠ and all
webservices with the authentication C# code below stopped, returning errors.
But this was thought windows mobile. At the time.. I had to take off
authentication on IISŠ now it's secure again (someday I tried to use the
authentication code and was okŠ I love "specialists").

Do you succeed inside your network to open the link of the webservice with
browser, write the password and see the content? When they changed our
proxy, this try was always fail.

Karl

From:  Brian Graham <brian.gra...@russellmcveagh.com>
Reply-To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Date:  Thu, 16 Jun 2011 10:07:13 +1200
To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Subject:  Re: [mono-android] NTLM Web Services

Thanks Karl,
 
I have tried that as well before I went to the more complicated use of
credential cache. It didn¹t work for me but if it works for you then I might
have something else wrong in my set up.
 
Regards
Brian
 

From: monodroid-boun...@lists.ximian.com
[mailto:monodroid-boun...@lists.ximian.com] On Behalf Of Karl Heinz Brehme
Arredondo
Sent: Wednesday, 15 June 2011 4:02 p.m.
To: monodroid@lists.ximian.com
Subject: Re: [mono-android] NTLM Web Services
 

Try something like that..:

 

NetworkCredential credential = new NetworkCredential("username",
"password");

TestService.Service1 ts = new TestService.Service1();

ts.Credentials = credential;

ts.PreAuthenticate = true;

identity.Text = ts.WhoAmI();

 

It's what I'm using on Windows Mobile, iOS and Android.

 

Karl

 

From: Brian Graham <brian.gra...@russellmcveagh.com>
Reply-To: "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Date: Mon, 13 Jun 2011 08:37:37 +1200
To: "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Subject: [mono-android] NTLM Web Services

 

Hi all, I asked this in the forum but didn't get any replies. Not sure if it
was because no one knows or if you guys didn't get the email. Sorry for the
re-post if you did get it the first time.

 

Anyway, has anybody successfully connected to a Webservice from Mono for
Android using Windows Authentication? I can connect if Anonymous is enabled
but as soon as I select Windows and give the service proxy the credentials
it comes back with a 401 error. This is the code:

                TestService.Service1 ts = new TestService.Service1();

                CredentialCache cache = new CredentialCache();

                cache.Add(new Uri(ts.Url), "Negotiate", new
NetworkCredential("username", "pasword"));

                 ts.Credentials = cache;

                ts.PreAuthenticate = true;

                identity.Text = ts.WhoAmI();

 

This code works perfectly from a Windows form test project so I know the
webservice itself is ok. I'm using the emulator and have changed the URL to
use the IP address of the host rather than "local", I have also tried "NTLM"
instead of "Negotiate".

Thanks in advance for any help.

 

Regards 

Brian 

 

Russell McVeagh

OFFICIAL LAW FIRM OF RUGBY WORLD CUP 2011

 

Winner - ALB Awards 2011: New Zealand Deal of the Year, Australasian Debt
Markets Deal of the Year.

 

Please think of the environment before printing this email.

 

________________________________________

This email contains confidential information and may be legally privileged.
If you have received it in error, you may not read, use, copy or disclose
this email or its attachments. In that case, please let us know immediately
by reply email and then delete this email from your system. While we use
standard virus checking software, we accept no responsibility for viruses or
anything similar in this email or any attachment after it leaves our
information systems. If you are interested in establishing more secure
communication between us, please contact our systems administrator by email
at mail.ad...@russellmcveagh.com

_______________________________________________

Monodroid mailing list

Monodroid@lists.ximian.com

 

UNSUBSCRIBE INFORMATION:

http://lists.ximian.com/mailman/listinfo/monodroid

 
_______________________________________________ Monodroid mailing list
Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to