Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 860
subhasis padhy Avatar asked Oct 31 '11 09:10

subhasis padhy


2 Answers

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.

like image 115
Catalin S. Avatar answered Sep 18 '22 18:09

Catalin S.


Are you expecting to extract the credentials? If yes, please see this -

http://msdn.microsoft.com/en-us/library/system.net.credentialcache.defaultcredentials.aspx

Here is what MSDN says - "The ICredentials instance returned by DefaultCredentials cannot be used to view the user name, password, or domain of the current security context."

However when you call the web service the API knows what it needs to do, so it will pass the credentials under which you are currently running.

like image 25
Nitin Rastogi Avatar answered Sep 21 '22 18:09

Nitin Rastogi