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

3

8

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

Archeozoic answered 31/10, 2011 at 9:35 Comment(0)
A
13

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.

Aplenty answered 26/10, 2012 at 9:23 Comment(0)
M
9

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.

Mounts answered 25/11, 2011 at 7:15 Comment(0)
K
1

Actually, I am not answering. But I could not find a way to reply your post. I have the same issue. You can try below things.

  1. Remove the anonymous authentication and set only windows authentication
  2. Even if you do that I know in windows 7 unless and until you set the application pool set to the specific user, you will not see the results you expect. That is where I am stuck with. If you already know the answer let me know.
Koopman answered 9/8, 2012 at 22:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.