Why are the System.Net.CredentialCache.DefaultCredentials always empty in and ASP application?

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

We have an anonymous web application trying to talk to a windows
authenticated webservice. This is currently failing with 401 Access Denied
errors.

We have found that we can get this to work by writing the following code in
the web application before calling the webservice:

WebServiceInstance.Credentials = new NetworkCredential("username",
"password","domain");


We don't want to have to do this because it means having to retrieve the
username and password again.

When searching for an answer, the following line constantly appears as the
correct solution:

WebServiceInstance.Credentials = CredentialCache.DefaultCredentials;


Unfortunatley the DefaultCredentials are empty. Why is this? We were
originally thinking (informed by a Microsoft Document) that because both
IIS machines have the same ASPNET account and password the Windows
authentication on the webservice side would be satisfied, but this doesn't
seem to be the case.

Please help we've been trying to get this working for almost 3 days now...

Thanks,
Craig
 
Back
Top