Re: Remote call to COM impersonating another user
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Tue, 8 Jan 2008 17:42:28 +0100
"JCav" <jcavanaugh@xxxxxxxxxxxx> wrote in message news:4783a140$0$28841$4c368faf@xxxxxxxxxxxxxxxxx
I'm new to this, so bear with me. I seem to be missing something.
When I call LogonUser, it fails, I think because the domain I need to log into is not available from the machine I run this from. When I use
the local domain it works fine - I become the other user when I impersonate him. This is how far I got before the original post. Is there a call
that sends this information to the server and tells it to do this? As I said, this works with whatever JIntegra does it.
You don't have to send this information to the server, it's the role of COM to authenticate the client and pass the security context to the server.
When you call CoInitializeSecurity, specifying DynamicCloaking (or StaticCloacking) very early in the process, COM will automatically pass the impersonation token of the client to the server, the server will use this token when impersonating (the server needs to call CoImpersonateClient for this).
What you need to take care of is that the token passed is an impersonating token, so be carefull when calling LogonUser, the token sent must be an impersonation token not a direct token.
That means that you'll have to specify a "batch" or "interactive" logon type when calling LogonUser, before calling Impersonate. Another option is to use a "network" logon type and call "DuplicateToken" before using the duplicated token in the Impersonate call.
Willy.
.
- Follow-Ups:
- References:
- Remote call to COM impersonating another user
- From: JCav
- Re: Remote call to COM impersonating another user
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Remote call to COM impersonating another user
- From: JCav
- Re: Remote call to COM impersonating another user
- From: Willy Denoyette [MVP]
- Re: Remote call to COM impersonating another user
- From: JCav
- Remote call to COM impersonating another user
- Prev by Date: Re: C# and HTML Help
- Next by Date: Re: C# Windows Service - allow multiple defined services?
- Previous by thread: Re: Remote call to COM impersonating another user
- Next by thread: Re: Remote call to COM impersonating another user
- Index(es):
Relevant Pages
|