Registering Authentication Keys

The INTERNET_OPEN_TYPE_PRECONFIG flag in the InternetOpen function looks at the registry values ProxyEnable, ProxyServer, and ProxyOverride. These values are located under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings key.

For authentication schemes other than Basic, a key needs to be added to the registry under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security key. A string value, DLLFile, should contain the name of the DLL that supports the authentication scheme. A DWORD value, Flags, should be set with the appropriate value.

The following table shows the possible values for the Flags value.

Flag value
Description
PLUGIN_AUTH_FLAGS_UNIQUE_CONTEXT_PER_TCPIP (value=0x01) Each TCP/IP socket contains a different context. Otherwise, a new context is passed for each realm or block URL template.
PLUGIN_AUTH_FLAGS_CAN_HANDLE_UI (value=0x02) This DLL can handle its own user input.
PLUGIN_AUTH_FLAGS_CAN_HANDLE_NO_PASSWD (value=0x04) This DLL might be capable of doing an authentication without prompting the user for a password.
PLUGIN_AUTH_FLAGS_NO_REALM (value=0x08) This DLL does not use a standard HTTP realm string. Any data that appears to be a realm is scheme-specific.
PLUGIN_AUTH_FLAGS_KEEP_ALIVE_NOT_REQUIRED (value=0x10) This DLL does not require a persistent connection for its challenge-response sequence.

For example, to add NTLM authentication, the subkey NTLM would need to be added to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security key. Under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Security\NTLM key, the string value, DLLFile, and a DWORD value, Flags, would need to be added. DLLFile would need to be set to Winsspi.dll, and Flags would need to be set to 0x08.