PC Review


Reply
Thread Tools Rate Thread

How can I pass Thread.CurrentPrincipal across AppDomain?

 
 
Stan
Guest
Posts: n/a
 
      30th Nov 2005
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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread.CurrentPrincipal Peter Larsen [CPH] Microsoft Dot NET Framework 4 8th Sep 2009 07:42 AM
Thread.CurrentPrincipal.Identity.Name Ken Microsoft Dot NET Framework 1 16th Nov 2007 12:50 AM
Thread.CurrentPrincipal.Identity.Name Ken Microsoft ASP .NET 2 14th Nov 2007 09:24 PM
Thread.CurrentPrincipal.Identity.Name Ken Microsoft C# .NET 1 14th Nov 2007 03:41 PM
AppDomain.SetThreadPrincipal vs. Thread.CurrentPrincipal Pradeep Microsoft Dot NET 0 13th Oct 2003 10:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 PM.