Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

ConvertAuthDataToToken function

The ConvertAuthDataToToken function creates an access token from the authorization data returned from the GetAuthDataForUser or GetUserAuthData functions.

Syntax


NTSTATUS ConvertAuthDataToToken(
  _In_  PVOID                        UserAuthData,
  _In_  ULONG                        UserAuthDataSize,
  _In_  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
  _In_  PTOKEN_SOURCE                TokenSource,
  _In_  SECURITY_LOGON_TYPE          LogonType,
  _In_  PUNICODE_STRING              AuthorityName,
  _Out_ PHANDLE                      Token,
  _Out_ PLUID                        LogonId,
  _Out_ PUNICODE_STRING              AccountName,
  _Out_ PNTSTATUS                    SubStatus
);

Parameters

UserAuthData [in]

Pointer to the authorization data received from the GetAuthDataForUser or GetUserAuthData functions.

UserAuthDataSize [in]

Size, in bytes, of the authorization data specified by the UserAuthData parameter.

ImpersonationLevel [in]

A SECURITY_IMPERSONATION_LEVEL value specifying the impersonation level for the token to be created.

TokenSource [in]

Pointer to a TOKEN_SOURCE structure specifying the source to record in the token.

LogonType [in]

A SECURITY_LOGON_TYPE value indicating the type of logon to record in the token.

AuthorityName [in]

Pointer to a UNICODE_STRING structure that specifies the name of the authority that authorized this user, typically a domain name.

Token [out]

Pointer to a HANDLE that receives the user token handle.

When you have finished using the user token, release the handle by calling CloseHandle.

LogonId [out]

Pointer to an LUID that receives the logon identifier for the token.

AccountName [out]

Pointer to a UNICODE_STRING structure that receives the account name encoded in the UserAuthData parameter.

SubStatus [out]

Pointer to a variable that receives additional information about the return value of the function call.

Return value

If the function succeeds, the return value is STATUS_SUCCESS.

If the function fails, the return value is an NTSTATUS code indicating the reason it failed.

Remarks

A pointer to the ConvertAuthDataToToken function is available in the LSA_SECPKG_FUNCTION_TABLE structure received by the SpInitialize function.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Ntsecpkg.h

See also

GetAuthDataForUser
GetUserAuthData
LSA_SECPKG_FUNCTION_TABLE
SECURITY_IMPERSONATION_LEVEL
SECURITY_LOGON_TYPE
SpInitialize
TOKEN_SOURCE
UNICODE_STRING

 

 

Community Additions

ADD
Show:
© 2015 Microsoft