CredentialCache.DefaultCredentials

Discussion in 'ASP .Net' started by J055, Nov 26, 2007.

  1. J055

    J055 Guest

    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
     
    J055, Nov 26, 2007
    #1
    1. Advertising

  2. 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)


    "J055" wrote:

    > 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
    >
    >
    >
     
    bruce barker (sqlwork.com), Nov 26, 2007
    #2
    1. Advertising

  3. J055

    J055 Guest

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

    Cheers
    Andrew
     
    J055, Nov 27, 2007
    #3
  4. 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 (, 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.
     
    Walter Wang [MSFT], Nov 29, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    1
    Views:
    11,059
    shobhaiyer
    Oct 3, 2007
  2. Guest
    Replies:
    1
    Views:
    491
    yuri vanzine
    Dec 9, 2003
  3. Paul Cheevers
    Replies:
    1
    Views:
    9,769
    Scott Allen
    Sep 7, 2004
  4. =?Utf-8?B?TmlrbGFzIFVobGlu?=

    Empty CredentialCache.DefaultCredentials

    =?Utf-8?B?TmlrbGFzIFVobGlu?=, Sep 11, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    5,429
    engsooonah
    Apr 10, 2007
  5. JOS
    Replies:
    0
    Views:
    573
Loading...

Share This Page