[MonoTouch] Windows Auth and MonoTouch
Gonzalo Paniagua Javier
gonzalo.mono at gmail.com
Fri Oct 2 09:09:10 EDT 2009
On Fri, 2009-10-02 at 04:04 +0000, Paul Bowden wrote:
> Hmm, that's what I was using before. The app works if Basic auth is enabled on the vdir, but if I disable Basic, which just leaves Windows Auth enabled, I get this:
>
> Unhandled Exception: System.Net.WebException: Invalid length. ---> System.FormatException: Invalid length.
> at (wrapper managed-to-native) System.Convert:InternalFromBase64String (string,bool)
> at System.Convert.FromBase64String (System.String s) [0x00000]
> at Mono.Http.NtlmSession.Authenticate (System.String challenge, System.Net.WebRequest webRequest, ICredentials credentials) [0x00000]
> at Mono.Http.NtlmClient.Authenticate (System.String challenge, System.Net.WebRequest webRequest, ICredentials credentials) [0x00000]
> at System.Net.NtlmClient.Authenticate (System.String challenge, System.Net.WebRequest webRequest, ICredentials credentials) [0x00000]
> at System.Net.AuthenticationManager.DoAuthenticate (System.String challenge, System.Net.WebRequest request, ICredentials credentials) [0x00000]
> at System.Net.AuthenticationManager.Authenticate (System.String challenge, System.Net.WebRequest request, ICredentials credentials) [0x00000]
> at System.Net.HttpWebRequest.CheckAuthorization (System.Net.WebResponse response, HttpStatusCode code) [0x00000]
> at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result) [0x00000]
> at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data) [0x00000]
>
> Here's the relevant part of the source:
>
> HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
> request.Method = "POST";
> request.ContentType = "text/xml; charset=utf-8";
> request.Credentials = new NetworkCredential(userName, password, domain);
Mmm, weird. There's only one more question before asking you to enter a
bug report for this: is the server using AD (and domain is set)? If so,
I think the machine from which you're running the program has to belong
to the domain...
-Gonzalo
More information about the MonoTouch
mailing list