Re: .NET Components in COM+
From: Malcolm Cudworth (MalcolmCudworth_at_discussions.microsoft.com)
Date: 07/06/04
- Next message: DotNetJunkies User: "Re: Populating a Typed DataSet with the MS Data Application Block"
- Previous message: A Mackie: "Re: Smart clients, DMZ and 4-tiers"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Jul 2004 06:28:02 -0700
If you need the assembly to run under a different identity than the code remoting into it use WindowsIdentity tokens to impersonate a user.
Basically use the LogonUser function from the win32 api and use the token returned in the impersonation:
i.e.
LogonUser(sName, sDomain, sPassword, LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT, oToken)
oIdentity = New WindowsIdentity(oToken)
oContext = oIdentity.Impersonate
"Paul Glavich [MVP - ASP.NET]" wrote:
> You can *not* place it in COM+ while you are debugging (ie. just inherit
> from MarshalByref instead of ServicedComponent) or if its just process
> identity you are after, you can do this via either machine.config (in the
> <processModel> section), or you can define a user within IIS or your
> Application Pool that the "anonymous" accounr runs under and enable
> impersonation so it runs under that account.
>
> --
> - Paul Glavich
> Microsoft MVP - ASP.NET
>
>
> "John" <John@discussions.microsoft.com> wrote in message
> news:4E17BA22-E91C-4DD0-AD0E-BEC1D68A2C90@microsoft.com...
> > I am working on a project which consists of ASP.NET to a COM+ component to
> SQL Server. The problem, or annoyance I am having, is that I am unable to
> easily debug the .NET component in COM+. I have to attach to the process by
> opening another instance of Visual Studio, put a break point, and if I find
> a bug, change the code, recompile and then reinstall into the GAC, and
> retest. A process which is not idea for rapid application development. I was
> told the the only reason that the component is in COM+ is that it is able to
> run under and different identity, and for security reasons it must be so.
> >
> > My question is whether putting a .NET compnent into COM+ is a good idea to
> begin with? Is the problem I just describe reason enough to find an
> alternate security model?
> >
> > thanks
> > John
>
>
>
- Next message: DotNetJunkies User: "Re: Populating a Typed DataSet with the MS Data Application Block"
- Previous message: A Mackie: "Re: Smart clients, DMZ and 4-tiers"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|