HttpWebRequest + Windows Auth - NetworkCredential just doesn't work

Viewed 20242

I have an ASP.NET MVC 4 web service. On my dev box, I'm running IIS Express 7.5, so we're calling localhost:port. I have set it to use Windows Authentication and switched off Anonymous.

On my client, if I set

HttpWebRequest.Credentials = CredentialCache.DefaultNetworkCredentials;

it works. But if I set the credentials to my other Windows domain account,

HttpWebRequest.Credentials = new NetworkCredential("lpuplett", "catsGoW00f", "ntdom"));

then I get a 401 Unauthorized. Am I misunderstanding something; should this work?

I've tried adding the credentials to a CredentialCache object and setting the cache.

1 Answers
Related