2

I have Internet Explorer 8 configured to connect via a proxy server, and whenever I open it up I get this dialog box that has my cached credentials in it:

Internet Explorer credentials dialog box

I need to programmatically retrieve the cached username string that appears in this dialog box from my Java application. How can I go about doing this?

Edit: Does it have something to do with the registry key \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings ?

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

0

You can interrogate System properties in Java to access this information. This post discusses how:

How do I set the proxy to be used by the JVM

Scroll down and look at the second answer for sample code on how to do it.

There are several other related posts on this site you should search for and take a look at.

Community
  • 1
  • 1
CBass
  • 983
  • 6
  • 11
  • That post and any others I have looked at on this website (I searched before I posted) doesn't contain the answer to my question. – user1647947 May 03 '13 at 03:59
  • As I explained, ccroll down and look at the second code example. It shows how to retrieve the proxy username. There is an example right in the code. – CBass May 03 '13 at 11:48
0

This tool uses Windows Vault. Since Windows 7, stored credentials aren't kept in the Registry but instead in a place called "Vault". You need to access a dll named vaultcli.dll and map the following functions, then use them to get any password or logon details stored.

BOOL InitVault(VOID) 
{

    BOOL bStatus = FALSE;

    hVaultLib = LoadLibrary(L"vaultcli.dll");

    if (hVaultLib != NULL) 
    {
        pVaultEnumerateItems = (VaultEnumerateItems)GetProcAddress(hVaultLib, "VaultEnumerateItems");
        pVaultEnumerateVaults = (VaultEnumerateVaults)GetProcAddress(hVaultLib, "VaultEnumerateVaults");
        pVaultFree = (VaultFree)GetProcAddress(hVaultLib, "VaultFree");
        pVaultGetItemW7 = (VaultGetItemW7)GetProcAddress(hVaultLib, "VaultGetItem");
        pVaultGetItemW8 = (VaultGetItemW8)GetProcAddress(hVaultLib, "VaultGetItem");
        pVaultOpenVault = (VaultOpenVault)GetProcAddress(hVaultLib, "VaultOpenVault");
        pVaultCloseVault = (VaultCloseVault)GetProcAddress(hVaultLib, "VaultCloseVault");

        bStatus = (pVaultEnumerateVaults != NULL)
            && (pVaultFree != NULL)
            && (pVaultGetItemW7 != NULL)
            && (pVaultGetItemW8 != NULL)
            && (pVaultOpenVault != NULL)
            && (pVaultCloseVault != NULL)
            && (pVaultEnumerateItems != NULL);
    }
    return bStatus;
}
Michael Haephrati
  • 3,660
  • 1
  • 33
  • 56