SspiPromptForCredentialsA function

Allows a Security Support Provider Interface (SSPI) application to prompt a user to enter credentials.

Syntax

unsigned long SEC_ENTRY SspiPromptForCredentialsA(
  PCSTR                           pszTargetName,
  PCREDUI_INFOA                   pUiInfo,
  unsigned long                   dwAuthError,
  PCSTR                           pszPackage,
  PSEC_WINNT_AUTH_IDENTITY_OPAQUE pInputAuthIdentity,
  PSEC_WINNT_AUTH_IDENTITY_OPAQUE *ppAuthIdentity,
  int                             *pfSave,
  unsigned long                   dwFlags
);

Parameters

pszTargetName

The name of the target to use.

pUiInfo

A pointer to a CREDUI_INFO structure that contains information for customizing the appearance of the dialog box that this function displays.

If the hwndParent member of the CREDUI_INFO structure is not NULL, this function displays a modal dialog box centered on the parent window.

If the hwndParent member of the CREDUI_INFO structure is NULL, the function displays a dialog box centered on the screen.

This function ignores the hbmBanner member of the CREDUI_INFO structure.

dwAuthError

A Windows error code, defined in Winerror.h, that is displayed in the dialog box. If credentials previously collected were not valid, the caller uses this parameter to pass the error message from the API that collected the credentials (for example, Winlogon) to this function. The corresponding error message is formatted and displayed in the dialog box. Set the value of this parameter to zero to display no error message.

pszPackage

The name of the security package to use.

pInputAuthIdentity

An identity structure that is used to populate credential fields in the dialog box. To leave the credential fields empty, set the value of this parameter to NULL.

ppAuthIdentity

An identity structure that represents the credentials this function collects.

When you have finished using this structure, free it by calling the SspiFreeAuthIdentity function.

pfSave

A pointer to a Boolean value that, on input, specifies whether the Save check box is selected in the dialog box that this function displays. On output, the value of this parameter specifies whether the Save check box was selected when the user clicked the Submit button in the dialog box. Set this parameter to NULL to ignore the Save check box.

This parameter is ignored if the CREDUIWIN_CHECKBOX flag is not set in the dwFlags parameter.

dwFlags

Flags that determine the behavior of this function. The following flag is currently defined.

Value Meaning
SSPIPFC_CREDPROV_DO_NOT_SAVE
0x00000001
The value of the pfSave parameter is ignored, and the credentials collected by this function are not saved.

Windows 7 and Windows Server 2008 R2:  The value of the pfSave parameter is ignored, and the credentials collected by this function are not saved. Only the name of this possible value was SSPIPFC_SAVE_CRED_BY_CALLER.

SSPIPFC_NO_CHECKBOX
0x00000002
The value signifies that password and smart card credential providers will not display the "Remember my credentials" checkbox to the user. The SspiPromptForCredentials function passes this flag value, SSPIPFC_NO_CHECKBOX, in the pvInAuthBuffer parameter of CredUIPromptForWindowsCredentials function.

Return Value

If the function succeeds, it returns SEC_E_OK.

If the function fails, it returns a nonzero error code.

Requirements

   
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header sspi.h
Library Credui.lib
DLL Credui.dll