How can I retrieve all the roles (groups) a user is a member of?
WindowsPrincipal.IsInRole just checks if the user is a member of the group with that name; a Windows Group is a Role. You can get a list of the groups that a user is a member of from the WindowsIdentity.Groups property. You can get WindowsIdentity from your WindowsPrincipal: WindowsIdentity identity = WindowsPrincipal.Identity as WindowsIdentity; or you … Read more