在 C# 中,以下代码将提供当前用户的身份验证类型:
System.Security.Principal.WindowsIdentity.GetCurrent().AuthenticationType;
返回值将是 NTLM 或 Kerberos。
如何使用 Windows API 获取相同的信息。我尝试通过 GetTokenInformation
定位信息,但没有一个信息类提供信息。我在 LSA 或授权中也找不到任何功能。
最佳答案
您使用 LsaGetLogonSessionData()。返回的 SECURITY_LOGON_SESSION_DATA.AuthenticationPackage 包含认证包名称。从GetTokenInformation获取你需要的LUID
关于c++ - 如何获取身份验证类型(如 WindowsIdentity.AuthenticationType 属性),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6716308/