|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Howto obtain WindowsIdentity for client calling method on COM+ application?That's in SecurityCallContext.CurrentCall.DirectCaller.AccountName --- Dominick Baier - DevelopMentor http://www.leastprivilege.com nntp://news.microsoft.com/microsoft.public.dotnet.security/<#ttsf3hLFHA.1***@TK2MSFTNGP15.phx.gbl> We have a COM+ application written in C# (a serviced component) thats get accessed by remote hosts on the network. How do I obtain the WindowsIdentity of the caller of my serviced-component? Regards Morten [microsoft.public.dotnet.security] Actually I want to get hold of the WindowsIdentity because I have to
impersonate the caller???? So how do you impersonate the caller? Regards Morten Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:uPSRshiLFHA.1176@TK2MSFTNGP12.phx.gbl... > You mean the name of the caller?? > > That's in SecurityCallContext.CurrentCall.DirectCaller.AccountName > > --- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > > > nntp://news.microsoft.com/microsoft.public.dotnet.security/<#ttsf3hLFHA.1***@TK2MSFTNGP15.phx.gbl> > > We have a COM+ application written in C# (a serviced component) thats get > accessed by remote hosts on the network. How do I obtain the > WindowsIdentity > of the caller of my serviced-component? > > > Regards Morten > > > > [microsoft.public.dotnet.security] Hello Morten,
ok - this works differently under Enterprise Services - you cannot get a WindowsIdentity object, as everything in COM+ is handled via the SecurityCallContext. To impersonate you have to P/Invoke CoImpersonateClient and CoRevertToSelf - this is straightforward... void IServer.OpenFileInClientContext(string FileName) { try { COMSec.CoImpersonateClient();? // Do work on behalf of the client? }? finally { COMSec.CoRevertToSelf();? } } class COMSec { [DllImport("OLE32.DLL", CharSet=CharSet.Auto)] public static extern uint CoImpersonateClient(); [DllImport("OLE32.DLL", CharSet=CharSet.Auto)] public static extern uint CoRevertToSelf(); } --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Actually I want to get hold of the WindowsIdentity because I have to > impersonate the caller???? > So how do you impersonate the caller? > Regards Morten > > "Dominick Baier [DevelopMentor]" > <dbaier@pleasepleasenospamdevelop.com> wrote in message > news:uPSRshiLFHA.1176@TK2MSFTNGP12.phx.gbl... > >> You mean the name of the caller?? >> >> That's in SecurityCallContext.CurrentCall.DirectCaller.AccountName >> >> --- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >> nntp://news.microsoft.com/microsoft.public.dotnet.security/<#ttsf3hLF >> HA.1***@TK2MSFTNGP15.phx.gbl> >> >> We have a COM+ application written in C# (a serviced component) thats >> get >> accessed by remote hosts on the network. How do I obtain the >> WindowsIdentity >> of the caller of my serviced-component? >> Regards Morten >> >> [microsoft.public.dotnet.security] >>
Re: RSA Encrypt/Decrypt Problems
License File Generator Using Digital Signatures SecurityCritical, SecurityTreatAsSafe and SecurityTransparent Attributes? ildasm Howto obtain WindowsIdentity for client calling method on COM+ application? Bouncy Castle C# crypto port Re: A single page from an existing application under SSL? |
|||||||||||||||||||||||