I guess it is by desing, but I would like to find a workaround:
Machine 1
-----------
// Attach GenericPrincipal to the thread
GenericIdentity MyIdentity = new GenericIdentity (UserId);
GenericPrincipal MyPrincipal = new GenericPrincipal (MyIdentity, Roles );
Thread.CurrentPrincipal = MyPrincipal;
// Machine1 calls ServicedComponent on Machine2
Machine 2
----------
if (Thread.CurrentPrincipal != null)
{
// Get UserId from the principal
string UserId = Thread.CurrentPrincipal.Identity.Name;
}
The component on Machine2 never gets CurrentPrincipa from the thread.
It did not catch me by surprise - it is a different machine, two components
are using DCOM, etc,
but I am thinking if there is a solution for that problem?
I need to get the user identity coming from DCOM client that is attaching it
its thread principal.
Is it possible?
Thanks,
-Stan
|