Why is a ServiceSecurityContext containing a WindowsIdentity property?
Namely, if the user is authenticated using the Windows authentication mechanism, then the ServiceSecurityContext.PrimaryIdentity and ServiceSecurityContext.WindowsIdentity properties contain exactly the same information, and if the user is authenticated using some other authentication mechanism, then ServiceSecurityContext.WindowsIdentity will contain empty identification.
Thus, in the first case, the WindowsIdentity property contains the same data as PrimaryIdentity, while in the second case it does not contain data at all (i.e., it contains an empty identification).
Thank you
source
share