How to do NTLMv2 auth when consuming web service in Xamarin.Android client?

Douglas G. Henke 0 Reputation points
2023-03-28T14:49:27.0533333+00:00

We have a legacy app built with Xamarin.Android that uses HttpWebRequest to consume a web service. We're authenticating with NTLM (not v2) by setting the HttpWebRequest.Credentials property to an appropriate NetworkCredential object.

The customer has observed that it is now 2023 and, therefore, NTLM is not a particularly optimal choice in terms of security. They wish now instead to use NTLMv2. HttpWebRequest seems to not support NTLMv2. (There's no way I can find to specify the auth version on the client side, and it does not successfully negotiate it with the server.)

What's the least-painful path to NTLMv2 support in a Xamarin.Android app?

(For those of you with your fingers poised above the "just use OAuth2" key: That's being considered. But for the purposes of this question, please assume we're stuck with NTLMv2.)

Thanks!

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,291 questions
{count} votes