J
jwh
Hello,
I'm trying to use the WindowsPrincipal object in an
ASP.NET application. We have users all across the country
in many different domains (for an example, let say one is
called userDomain). We have set up Windows groups in a
different domain (let's call it groupDomain).
Here is my code for a user in the userDomain:
WindowsPrincipal myUser = User as WindowsPrincipal;
if (myUser.IsInRole(@"groupDomain\GroupOne"))
{
// user's name is userDomain\UserOne
Label1.Text = "User is In Role";
}
else
Label1.Text = "User NOT in Role";
My problem is that IsInRole ALWAYS returns false. It only
returns true if I ask about groups in the BUILTIN domain
or in the domain that the user belongs to (userDomain).
Further, when I look at the myUser object in the Locals
window after a call to IsInRole, I see the listing of
m_roles and I see none of the groupDomain roles. I've
tested this several different ways and it seems that
IsInRole only checks the domain that the user belongs to
as well as the built in groups.
Any Help?
I'm trying to use the WindowsPrincipal object in an
ASP.NET application. We have users all across the country
in many different domains (for an example, let say one is
called userDomain). We have set up Windows groups in a
different domain (let's call it groupDomain).
Here is my code for a user in the userDomain:
WindowsPrincipal myUser = User as WindowsPrincipal;
if (myUser.IsInRole(@"groupDomain\GroupOne"))
{
// user's name is userDomain\UserOne
Label1.Text = "User is In Role";
}
else
Label1.Text = "User NOT in Role";
My problem is that IsInRole ALWAYS returns false. It only
returns true if I ask about groups in the BUILTIN domain
or in the domain that the user belongs to (userDomain).
Further, when I look at the myUser object in the Locals
window after a call to IsInRole, I see the listing of
m_roles and I see none of the groupDomain roles. I've
tested this several different ways and it seems that
IsInRole only checks the domain that the user belongs to
as well as the built in groups.
Any Help?