SspiEncodeAuthIdentityAsStrings function (sspi.h)

Encodes the specified authentication identity as three strings.

Syntax

SECURITY_STATUS SEC_ENTRY SspiEncodeAuthIdentityAsStrings(
  [in]  PSEC_WINNT_AUTH_IDENTITY_OPAQUE pAuthIdentity,
  [out] PCWSTR                          *ppszUserName,
  [out] PCWSTR                          *ppszDomainName,
  [out] PCWSTR                          *ppszPackedCredentialsString
);

Parameters

[in] pAuthIdentity

The credential structure to be encoded.

[out] ppszUserName

The marshaled user name of the identity specified by the pAuthIdentity parameter.

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

[out] ppszDomainName

The marshaled domain name of the identity specified by the pAuthIdentity parameter.

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

[out] ppszPackedCredentialsString

An encoded string version of a SEC_WINNT_AUTH_IDENTITY_EX2 structure that specifies the users credentials.

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

Return value

If the function succeeds, it returns SEC_E_OK.

If the function fails, it returns a nonzero error code. Possible values include, but are not limited to, those in the following table.

Return code/value Description
STATUS_INVALID_PARAMETER
0xC000000D
The SEC_WINNT_AUTH_IDENTITY_FLAGS_PROCESS_ENCRYPTED flag is set in the identity structure specified by the pAuthIdentity parameter.

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 sspi.h
Library Secur32.lib
DLL SspiCli.dll