Accessing credentials cached by wininet from .NET Framework

From: Marcus F (
Date: 03/16/04

  • Next message: bob: "Re: siteminder"
    Date: Tue, 16 Mar 2004 08:36:09 -0800


    As I understand it, if I visit a web page in IE that requires authentication, wininet.dll calls InternetErrorDlg (ERROR_INTERNET_INCORRECT_PASSWORD) which prompts the user for their username and password. Once the correct credentials have been supplied, these are then cached by wininet.dll and will be tried when accessing secured resources within that site, regardless of which instance of IE makes the call, until the last instance of IE has been unloaded and the memory released.

    I am calling system.Web.HttpRequest in the .NET Framework, to access a resource that I have already authenticated to within IE. I can only connect to it if I explicitly specify credentials:

    request.Credentials = New NetworkCredential("username", "password")

    How can I access and reuse the credentials that the user supplied, that are already cached by wininet.dll rather than the user having to be prompted for the same set of credentials twice?

    Thanks in advance!

  • Next message: bob: "Re: siteminder"