Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: "Eric" <bigfoot@xxxxxxxxxxxxxxxx>
- Date: Mon, 6 Mar 2006 10:23:06 -0000
Thanks Luke,
So if I understand, I need t o create a WindowsPrincipal from The IPrincipal
for the IsInRole to work properly. I try to do this:
WindowsPrincipal wp = Thread.CurrentPrincipal as WindowsPrincipal;
but in this case wp is NULL, the conversion does not wotk. I tried to create
a WindowsIdentity so I could create a WindowsPricipal, but I can not find
how you get the TOKEN fron the IPrincipal (needed to construct the
WindowsIdentidy).
Any advise?
Cheers,
Eric
"Luke Zhang [MSFT]" <lukezhan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:vfksuzMQGHA.6016@xxxxxxxxxxxxxxxxxxxxxxxx
Hello,
In your code, "aWinPrinc" is a WindowsPrincipal, but
Thread.CurrentPrincipal implements from IPrincipal, it is a
GenericPrincipal Class actually. They are not same classes yet. And the
underly arithmetic in IsInrole() method is also not same. WindowsPrincipal
will call a Windows API CheckTokenMembership() to get the result of
IsInRole(); GenericPrincipal totally rely on current Role provider.
Regards,
Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
.
- Follow-Ups:
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- References:
- RE: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Eric
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- RE: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Prev by Date: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Next by Date: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Previous by thread: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Next by thread: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Index(es):
Relevant Pages
|