Re: Web service Impersonatation?
From: Frank Wisniewski (fpw23_at_hotmail.com)
Date: 12/07/04
- Next message: Consultant: "Re: Web service Impersonatation?"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 7 Dec 2004 09:56:20 -0600
Thanks Nicholas,
But how do you know which Principal is being used by your code. Lets say I
have a routine that writes a file to the local directory, how do I ensure
that code is using my impersonated users rights?
-- Frank Wisniewski MCSE 4.0, MCP+I, A+ f p w 2 3 @ h o t m a i l . c o m "Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in message news:%23GhWBSH3EHA.2676@TK2MSFTNGP12.phx.gbl... > Frank, > > No, they should not. When you impersonate through the WindowsIdentity > object, it does not change the current principal on the thread. The reason > for this is that you can have different implementations of IPrincipal which > don't necessarily map to windows users and groups. To that end, having > WindowsIdentity change the current thread's principal would be wrong. > > Hope this helps. > > > -- > - Nicholas Paldino [.NET/C# MVP] > - mvp@spam.guard.caspershouse.com > > "Frank Wisniewski" <fpw23@hotmail.com> wrote in message > news:41b5cf8c$1_2@Usenet.com... > > When I set up impersonation in the web.config file and specify a user and > > password I get strange results. This line of code will get me the user > > account I set to impersonate: > > System.Security.Principal.WindowsIdentity.GetCurrent().Name > > > > This line of code will get me my user account ever time: > > > > System.Threading.Thread.CurrentPrincipal.Identity.Name > > > > What's the difference? shouldn't they both be the user I am trying to > > impersonate? > > > > Thanks > > > > > > Frank Wisniewski MCSE 4.0, MCP+I, A+ > > f p w 2 3 @ h o t m a i l . c o m > > > > > >
- Next message: Consultant: "Re: Web service Impersonatation?"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Web service Impersonatation?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|