Ajay
Ajay

Reputation: 18429

How to get Authentication Type (like WindowsIdentity.AuthenticationType property)

In C#, the following code would give authentication type of current user:

System.Security.Principal.WindowsIdentity.GetCurrent().AuthenticationType;

The returned value would be either NTLM or Kerberos.

How do I get same information using Windows API. I tried locating information through GetTokenInformation, but none of information classes serve the information. I couldn't find any functions in LSA or Authorization also.

Upvotes: 0

Views: 1135

Answers (1)

Hans Passant
Hans Passant

Reputation: 942000

You use LsaGetLogonSessionData(). The returned SECURITY_LOGON_SESSION_DATA.AuthenticationPackage contains the authentication package name. Get the LUID you need from GetTokenInformation

Upvotes: 2

Related Questions