BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

asking for user credentials

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX)
View previous topic :: View next topic  
Author Message
nicolasr
Guest





PostPosted: Thu Feb 08, 2007 12:27 am    Post subject: asking for user credentials Reply with quote



Hi,

I'm working on a DCOM server application that is accessed
by clients from remote machines. For this to work I had to
create a "mirror" user account on the machine the server runs
on for every client.
Since not every client should be able to access the same
information I want to check which client/user is currently
asking for a specific information.
Is there a way to find out which user account connected to
my server and called some function from within the function called?

thanks for any idea,
Nicolas
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Feb 08, 2007 2:19 am    Post subject: Re: asking for user credentials Reply with quote



"nicolasr" <nicolasrREMOVETHISSPAMBLOCKER (AT) gmx (DOT) net> wrote in message
news:45ca1a56$1 (AT) newsgroups (DOT) borland.com...

Quote:
Is there a way to find out which user account connected to
my server and called some function from within the function
called?

I was just looking for that exact same thing last week. I wanted my
COM out-of-process server to grab the Windows username of the calling
client inside one of my COM methods. I did not find anything definate
in that area. I did run across CoImpersonateClient(), hoping I could
impersonate the calling client and then use GetUserName(), but I do
not think it would work for me because the docs say
CoImpersonateClient() doesn't work for RPC_C_AUTHN_LEVEL_NONE
authentication, which I do use.


Gambit
Back to top
nicolasr
Guest





PostPosted: Thu Feb 08, 2007 3:48 am    Post subject: Re: asking for user credentials Reply with quote



thanks Remy for your reply.

I will try what you suggested. Other things I found were

CoImpersonateClient
OpenThreadToken
GetTokenInformation
LookupAccountSid

or

CoQueryClientBlanket

but could get none of them consistently work yet.

Nicolas


Quote:
I was just looking for that exact same thing last week. I wanted my
COM out-of-process server to grab the Windows username of the calling
client inside one of my COM methods. I did not find anything definate
in that area. I did run across CoImpersonateClient(), hoping I could
impersonate the calling client and then use GetUserName(), but I do
not think it would work for me because the docs say
CoImpersonateClient() doesn't work for RPC_C_AUTHN_LEVEL_NONE
authentication, which I do use.


Gambit

Back to top
vavan
Guest





PostPosted: Thu Feb 08, 2007 9:10 am    Post subject: Re: asking for user credentials Reply with quote

On Wed, 7 Feb 2007 19:27:56 +0100, "nicolasr"
<nicolasrREMOVETHISSPAMBLOCKER (AT) gmx (DOT) net> wrote:

Quote:
Is there a way to find out which user account connected to
my server and called some function from within the function called?

I use CoQueryClientBlanket to identify calling client in my DCOM
servers

--
Vladimir Ulchenko aka vavan
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (ActiveX) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.