CredentialCache.DefaultCredentials

J

J055

Hi

I'm using the following code to get a response froma server which uses IIS6
and Integrated Security. I don't understand where the credentials are stored
on the client, i.e. the Visual Studio web server. How do I clear them? What
are DefaultCredentials? The username and password I've been using to connect
to a remote server are not the client, i.e. XP logged on user account. I
don't know where the DefaultCredentials has picked them up from.

HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("https://a.server.com/admin");
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();

If someone provides me with a username and password to log on to their IIS6
machine using the Integrated Security how to I explicitly set the
credentials?

thanks
Andrew
 
B

bruce barker (sqlwork.com)

the defaultCredential is the nt identity of the current thread. to connect to
another server using a different login try:

CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(url),
"NTLM",
new NetworkCredential(userName,password,domainName));
request..Credentials = myCache;

-- bruce (sqlwork.com)
 
J

J055

Thanks for that. How can I find a list of stored default and other
credentials?

Cheers
Andrew
 
W

Walter Wang [MSFT]

Hi Andrew,

I'm not sure what do you mean by "find a list of stored default and other
credentials". Could you please depict more?


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top