Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Remoting / July 2006

Tip: Looking for answers? Try searching our database.

problem with credentials in remoting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ThunderMusic - 26 Jul 2006 21:44 GMT
Hi,
Let me explain my architecture : Client-->ServerA-->ServerB

So, Client makes a call to ServerA which returns an object gotten from
ServerB... The credentials are passed from Client to ServerB my using
Impersonation on ServerA...

The problem is the following :
ServerB is a Windows Service...  it starts a process (worker thread)...
when the service starts it, it starts with the Service's credentials, which
is fine...  When the Client calls StopProcess() the thread finishes with the
Service's credentials (like it started), but when the Client calls
StartProcess(), the thread is restarted but with the Client's credentials
because Thread.CurrentPrincipal is now the Client's credentials... Is it
really what's happenning? (it really seems to be)

Is there a solution to this? Is it possible to tell the thread to work on
specific credentials? and is it possible to get the service credentials
back?

thanks

ThunderMusic
Lancelot@community.nospam - 26 Jul 2006 21:57 GMT
Hi Thunder,
  You can tell you thread to revert to itself in order to perform some
task.

           // Switch to the 'orignal' identity
           WindowsImpersonationContext context =
WindowsIdentity.Impersonate( IntPtr.Zero );
           try
           {
               // do your stuff.
           }
           finnaly
           {
               // Back to the caller's identity
               context.Undo();
           }

This will switch your server to its primary identity, the identity under
which it runs. Once you are done, just switch back.

Good luck

-Martin

> Hi,
> Let me explain my architecture : Client-->ServerA-->ServerB
[quoted text clipped - 19 lines]
>
> ThunderMusic
ThunderMusic - 27 Jul 2006 13:19 GMT
Excellent!!  thanks a lot

> Hi Thunder,
>   You can tell you thread to revert to itself in order to perform some
[quoted text clipped - 43 lines]
>>
>> ThunderMusic

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.