Share via


SetADAuthenticatedUser callback function

Applies to: desktop apps only

The SetADAuthenticatedUser callback function is used by Web filters to set the authenticated Windows user. This enables associating information about an authenticated user with the current request.

The SetADAuthenticatedUser callback function is declared as:

Syntax

BOOL WINAPI SetADAuthenticatedUser(
  _In_  struct _HTTP_FILTER_CONTEXT *pfc,
  _In_  LPSTR lpszUserName ,
  _In_  LPSTR lpszPassword ,
  _In_  HANDLE hToken 
);

Parameters

  • pfc [in]
    Pointer to the HTTP_FILTER_CONTEXT data structure that is associated with the current, active HTTP session. Pass the filter context in this parameter.

  • lpszUserName [in]
    Pointer to a null-terminated string containing the user name.

  • lpszPassword [in]
    Pointer to a null-terminated string containing the user password.

  • hToken [in]
    Token handle.

Return value

This callback function returns TRUE if the call is successful; otherwise, it returns FALSE. To obtain extended error information, call GetLastError.

Remarks

The user token is received using the Security Support Provider Interface (SSPI) layer.

If there is a token, there is no need to pass the password. However, if the token field is NULL, you should provide the password. The user name must be provided if there is a token or if the token field is NULL.

After you provide the token handle to the function, you should close the token handle to prevent handle leaks.

Web filters call the SetADAuthenticatedUser function through a pointer that is a member of the WPX_FILTER_AUTHENT_EX structure. A pointer to this structure is passed in each call to the HttpFilterProc entry-point function when the Web proxy sends an SF_NOTIFY_AUTHENTICATION notification to the Web filters that are registered to receive this notification just before Forefront TMG authenticates a client. If the fAuthIsRequired member of the WPX_FILTER_AUTHENT_EX structure is set to FALSE, the call to SetADAuthenticatedUser succeeds, but the user specified is not set as an authenticated user.

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only)

Version

Forefront Threat Management Gateway (TMG) 2010

Header

Wpxhttpfilt.h

See also

Callback Functions

 

 

Build date: 7/12/2010