WINHTTP_CREDS structure (winhttp.h)
The WINHTTP_CREDS structure contains user credential information used for server and proxy authentication.
Syntax
typedef struct tagWINHTTP_CREDS {
LPSTR lpszUserName;
LPSTR lpszPassword;
LPSTR lpszRealm;
DWORD dwAuthScheme;
LPSTR lpszHostName;
DWORD dwPort;
} WINHTTP_CREDS, *PWINHTTP_CREDS;
Members
lpszUserName
Pointer to a buffer that contains username.
lpszPassword
Pointer to a buffer that contains password.
lpszRealm
Pointer to a buffer that contains realm.
dwAuthScheme
A flag that contains the authentication scheme, as one of the following values.
lpszHostName
Pointer to a buffer that contains hostname.
dwPort
The server connection port.
Remarks
This structure is used with options WINHTTP_OPTION_GLOBAL_SERVER_CREDS and WINHTTP_OPTION_GLOBAL_PROXY_CREDS option flags. These options require the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings!ShareCredsWithWinHttp. This registry key is not present by default.
When it is set, WinINet will send credentials down to WinHTTP. Whenever WinHttp gets an authentication challenge and if there are no credentials set on the current handle, it will use the credentials provided by WinINet. In order to share server credentials in addition to proxy credentials, users needs to set the WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS option flag.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Header | winhttp.h |