IsInRole not working across Domains

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?
 
?

=?iso-8859-1?Q?Johan_Norm=E9n_NSQUARED2?=

"...it seems that
IsInRole only checks the domain that the user belongs to
as well as the built in groups."

Yes that's seems to be true.
I think you must use DirecoryService and make your own
impelemention.

JN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top