How to use WindowsIdentity class in Windows Authentication in C#
When your project is based on Windows authentication you can access some additional information about the currently authenticated user by casting the general identity object to a WindowsIdentity object. The next table lists additional members provided by WindowsIdentity:
Member
Description
IsAnonymous
Returns true if the user is anonymous (has not been authenticated).
IsGuest
Returns true if the user is using …