Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the calling username in a DCOM object ?

Status
Not open for further replies.

Bart9140

Programmer
Aug 1, 2001
8
0
0
NL
Hi,

We want to know how we can identify the user(s) who creates an instance of our class on the server
(so user1 on a client creates an instance of an object on our server, how do we know on the server that it was user1
).

This way we can do our own security if we want to get information on our legacy systems.

Thanks a lot !
 
CoImpersonateClient
OpenThreadToken
GetTokenInformation(...,TokenUser,...
CoRevert2Self
 
Thanx alot volkoff for giving us such a usefull info.
I want to use this in my VC++ com components on MTS.
Could u please give me the exact syntax of these commands so that i can use it.
I am not getting any ex. or help on OpenThreadToken( which thread handle i have to pass etc..)

Sorry for the botheration

Regards,
Shuchi
 
Howdy,

In VB:

In a MTS enabled class:

Public property Get OriginalUsername() As String
Dim objCtx As ObjectContext
Set objCtx = GetObjectContext()
OriginalUsername = objCtx.Security.GetOriginalCallerName
Set objCtx = Nothing
End Property

Greetz,
Kees
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top