How to get user groups without active directory...

Hello.

I need a list of grups (roles) of a logged user (without Active Directory)

I've been searching info about how to get groups that a user belongs to, and i've found this way to do it:

public static string[] groupList(System.Security.Principal.WindowsIdentity wId)
{
Type type = wId.GetType();
Object[] arr = new Object[] { wId.Token };
Object oRoles = type.InvokeMember("_GetRoles", BindingFlags.Static |
BindingFlags.InvokeMethod | BindingFlags.NonPublic, null, wId, arr);
return (string[])oRoles;
}

This code invokes to a static private member of the class WindowsIdentity (_GetRoles).

I do not like much this solution, because hacking .NET is not good ....

Do you know other way to get this information

Thanks.



Answer this question

How to get user groups without active directory...