LsaCallAuthenticationPackage(LsaHandle, AuthenticationPackage, MessageType, ProtocolSubmitBuffer)

Requests the services of an authentication package


LsaHandle : PyLsaLogon_HANDLE

Lsa handle as returned by win32security::LsaRegisterLogonProcess or win32security::LsaConnectUntrusted

AuthenticationPackage : int

Id of authentication package to call, as returned by win32security::LsaLookupAuthenticationPackage

MessageType : int

Type of request that is being made, Kerb*Message or MsV1_0* constant

ProtocolSubmitBuffer : object

Type is dependent on MessageType


Message type is embedded in different types of submit buffers in the API call, but passed separately from python for simplicity of parsing input

MessageType Input type
KerbQueryTicketCacheMessagelong - a logon id, use 0 for current logon session
KerbRetrieveTicketMessagelong - a logon id, use 0 for current logon session
KerbPurgeTicketCacheMessage(long, PyUnicode, PyUnicode) - tuple containing (LogonId, ServerName, RealmName)
KerbRetrieveEncodedTicketMessage(LogonId, TargetName, TicketFlags, CacheOptions, EncryptionType, CredentialsHandle) (int, PyUnicode, int, int, int, PyCredHandle)

MessageType Return type
KerbQueryTicketCacheMessage(dict,...) - Returns all tickets for the specified logon session (form is KERB_TICKET_CACHE_INFO)
KerbRetrieveTicketMessageReturns the ticket granting ticket for the logon session as a KERB_EXTERNAL_TICKET
KerbRetrieveEncodedTicketMessageReturns specified ticket as a KERB_EXTERNAL_TICKET

Return Value

Type of returned object is dependent on MessageType