views:

130

answers:

1

I am working on a Win7 system with the local security policy

Network Security: LAN Manager authentication level set to use NTLMv2 only.

In a piece of code I am using the .NET WebClient class as follows:

WebClient webClient = new WebClient();
NetworkCredential networkCredential = 
  new NetworkCredential(DomainAccountUserName, DomainAccountPassword, Domain);
webClient.Credentials = networkCredential;
webClient.DownloadFile(downloadUrl, filePath);

The problem (I think) is that the machine I am requesting authentication to can only do NTLMv1 as it is CentOS/Apache. How can Instruct WebClient to use NTLMv1?

I know I can do:

webClient.Credentials = networkCredential.GetCredential(
                                      new Uri(downloadUrl), "NTLM");

but this still defaults to NTLMv2 -- Are there any solutions?

A: 

How would it be possible to create a c# application which uses NTLMv1? Web browsers can do it so there must be a way aside from changing machine policy?

Also, how did you verify that it was defaulting to NTLMv2 ?

Shane