WS_VALIDATE_PASSWORD_CALLBACK callback function (webservices.h)

Validates a username/password pair on the receiver side. When a WS_USERNAME_MESSAGE_SECURITY_BINDING containing this callback is included in the security description, this callback is invoked for each received message at the server. This callback is expected to return S_OKif the username/password pair was successfully validated, S_FALSE when the pair could not be validated and an error value if an unexpected error occurred. Returning any result other than S_OK from this callback will result in the associated receive message failing with a security error.

As with all security callbacks, the application should expect to receive this callback any time between channel/listener open and close, but it will never be invoked when a channel is not open. In the current drop, this callback is always invoked synchronously. In the next drop, this callback will be invoked synchronously for synchronous message receives and asynchronously for asynchronous message receives, but it will always be invoked short when it is invoked asynchronously.

Syntax

WS_VALIDATE_PASSWORD_CALLBACK WsValidatePasswordCallback;

HRESULT WsValidatePasswordCallback(
  [in, optional] void *passwordValidatorCallbackState,
  [in]           const WS_STRING *username,
  [in]           const WS_STRING *password,
  [in, optional] const WS_ASYNC_CONTEXT *asyncContext,
  [in, optional] WS_ERROR *error
)
{...}

Parameters

[in, optional] passwordValidatorCallbackState

The state to be passed back when invoking this callback.

[in] username

Received username.

[in] password

Received password.

[in, optional] asyncContext

Information on how to invoke the function asynchronously, or NULL if invoking synchronously.

[in, optional] error

Specifies where additional error information should be stored if the function fails.

Return value

This callback function does not return a value.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header webservices.h