HttpAuthenticate Function  
 
INT WINAPI HttpAuthenticate(
  HCLIENT hClient,  
  UINT nAuthType,  
  LPCTSTR lpszUsername,  
  LPCTSTR lpszPassword  
);

Parameters

hClient
Handle to the client session.
nAuthType
An unsigned integer value which specifies the method to be used when authenticating the client. The following values are recognized.
Constant Description
HTTP_AUTH_NONE This option specifies that no client authentication should be performed. The lpszUsername and lpszParameters are ignored and current authentication settings are cleared.
HTTP_AUTH_BASIC This option specifies that the basic authentication scheme should be used. This option is supported by all servers that support at least version 1.0 of the protocol.
lpszUsername
A pointer to a null-terminated string that specifies the username used to authenticate the client session.
lpszPassword
A pointer to a null-terminated string that specifies the password used to authenticate the client session.

Return Value

If the function succeeds, the return value is zero. If the function fails, the return value is HTTP_ERROR. To get extended error information, call HttpGetLastError.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use cshtpav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

HttpAsyncConnect, HttpConnect, HttpCreateFile, HttpDeleteFile, HttpOpenFile