[Mono-dev] Simple web service test with windows authentication
marcos b
marcosb at internet.com.uy
Fri Nov 28 06:47:25 EST 2008
Thanks guys for the answers.
The simplest (not the safest) solution that I found is using Basic
Authentication in IIS and passing the credentials in plain text using
NetworkCredentials object in .net mono client.
Ryan Bair wrote:
>
> Most of it is not proprietary. SPNEGO and GSSAPI make up most of it
> with an option for the proprietary but reasonably well documented
> NTLMv2.
>
> That said, it is not implemented AFAIK.
>
> 2008/11/27 Rafael Teixeira <monoman at gmail.com>:
>> AFAIK, we don't implement the proprietary protocol for Windows
>> Authentication.
>> See
>> http://msdn.microsoft.com/en-us/library/ms978378.aspx#authaspdotnet_authentication
>> for an overview with alternatives.
>>
>> On Wed, Nov 26, 2008 at 3:39 PM, marcos b <marcosb at internet.com.uy>
>> wrote:
>>>
>>> I'm trying to do a web service invocation using mono. The web service is
>>> hosted on my machine using iis. Windows authentication is used in the
>>> web.config and in iis.
>>> The test runs ok using .net environment but throws an Unauthorized
>>> exception
>>> when using mono.
>>>
>>> I don't know if this is a bug or I'm missing something...
>>>
>>> Thanks in advance
>>>
>>> [Test]
>>> public void WebServiceTest()
>>> {
>>> WS.Service1 s=new app.WS.Service1();
>>> //s.UseDefaultCredentials = true; //Also throws an
>>> exception
>>> //s.Credentials = CredentialCache.DefaultCredentials; //Also
>>> throws an exception
>>> s.Credentials = new NetworkCredential("myLogin", "12345678",
>>> "myDomain");
>>> Assert.AreEqual(s.Add(3,5),8);
>>> }
>>>
>>> Exception
>>>
>>> detail-----------------------------------------------------------------------------
>>>
>>> TestCase 'app.MonoWebTests.WebServiceTest'
>>> failed: System.Net.WebException : The request failed with HTTP status
>>> 401:
>>> Unauthorized
>>> at
>>> System.Web.Services.Protocols.SoapHttpClientProtocol.ReceiveResponse
>>> (System.Net.WebResponse response,
>>> System.Web.Services.Protocols.SoapClientMessage message,
>>> System.Web.Services.Protocols.SoapExtension[] extensions) [0x00000]
>>> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke
>>> (System.String method_name, System.Object[] parameters) [0x00000]
>>> at app.WS.Service1.Sumar (Int32 a, Int32 b) [0x00000]
>>> at (wrapper remoting-invoke-with-check) app.WS.Service1:Sumar
>>> (int,int)
>>> at app.MonoWebTests.WebServiceTest () [0x00000]
>>> at (wrapper managed-to-native)
>>> System.Reflection.MonoMethod:InternalInvoke
>>> (object,object[],System.Exception&)
>>> at System.Reflection.MonoMethod.Invoke (System.Object obj,
>>> BindingFlags
>>> invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
>>> System.Globalization.CultureInfo culture) [0x00000]
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Simple-web-service-test-with-windows-authentication-tp20705699p20705699.html
>>> Sent from the Mono - Dev mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>
>> --
>> Rafael "Monoman" Teixeira
>> ---------------------------------------
>> "I myself am made entirely of flaws, stitched together with good
>> intentions."
>> Augusten Burroughs
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
--
View this message in context: http://www.nabble.com/Simple-web-service-test-with-windows-authentication-tp20705699p20733094.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
More information about the Mono-devel-list
mailing list