MonoTouch support for accessing Mono.Security.Protocol.Ntlm.NtlmFlags

ε祈祈猫儿з 提交于 2019-12-13 14:09:58

问题


We use NTLM auth to access an ASP.net web services from our MonoTouch app and everything works fine.

One of our customers uses the same app and the NTLM auth fails from our app but works from the iPad's Safari browser.

Looking at the packet flow from the customer, the server does not return NTLMSSP_CHALLENGE, when our app sends NTLMSSP_NEGOTIATE message.

Looking the differences between our app's NTLMSSP_NEGOTIATE message and iPad's Safari same message Our MT app sets the NTLM flags to 0xb203 and Safari sets this to 0x88207. The NegotiateNtlm2Key is set to 0 in our app and 1 in Safari Our app also sends the calling workstation domain and name fields whereas Safari send both as null.

The client's server is Windows Server 2003 and they also use Kerberos as their main authentication scheme and fall back on NTLM.

Would setting the NegotiateNtlm2Key flags in Mono.Security.Protocol.Ntlm.NtlmFlags help?


回答1:


NTLMv2 Session and NTLMv2 Authentication has now been implemented in Mono (mono/master commit 45745e5).

See this article for a description of the different NTLM versions.

By default, Mono now uses NTLMv2 Session Authentication whenever the server supports it and falls back to LM & NTLM otherwise.

The default behavior can be configured by using the new Mono.Security.Protocol.Ntlm.Type3Message.DefaultAuthLevel property in Mono.Security.dll (see Type3Message.cs and NtlmAuthLevel.cs in mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm).

This is similar to the Lan Manager Authentication Level in Windows.

Update 01/26/13

There has been an issue with Microsoft Server 2008 RC2 not accepting the domain name that it sent back in the Type 2 Message's Target Name (or Domain Name from the Target Info block).

Therefore, we are now using the domain name from the NetworkCredential to allow the user to specify the desired domain. This is also the domain name that's initially being sent to the server in the Type 1 Message.




回答2:


Simply setting flags ? Maybe but IMHO that's quite unlikely.

That code base was written in 2003 (and updated in 2004) and I'm pretty sure that I (as the author of the low-level code) did not have access to a Windows 2003 server or a Kerberos-enabled domain at that time.

The amount of required change, for a fallback, might not be too large (but I would not bet 5$ on that ;-) if you already have the environment to test it. I'm 100% positive that the Mono project would be happy to receive patches to enable this. You can also fill a bug report (priority enhancement) to ask for this feature at http://bugzilla.xamarin.com

An alternative is to use the iOS API, which I assume Safari is using, to communicate with the ASP.NET web service and deserialize the data yourself. Hard to say which options is more complex.



来源:https://stackoverflow.com/questions/8235141/monotouch-support-for-accessing-mono-security-protocol-ntlm-ntlmflags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!