system.net.credentialcache.defaultcredentials is always empty in MOSS 2007 webpart

subhasis padhy picture subhasis padhy · Oct 31, 2011 · Viewed 21k times · Source

I am trying to pass user credential to a webservice using

system.net.credentialcache.defaultcredentials inside MOSS 2007 webpart. But the credential shows always empty.I ma using integrated windows authentication

Answer

Catalin S. picture Catalin S. · Oct 26, 2012

You will never see the credentials in debug. But they will be correctly passed to where they are needed. And when using anonymous authentication the client will not send the authentication header to be used. You need to set anonymous authentication disabled.