Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / June 2005



Tip: Looking for answers? Try searching our database.

COM+ Identify User calling Method

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
devmo@newsgroup.nospam - 28 Jun 2005 19:28 GMT
I have a DLL running as a COM+ application.  The application is configured
to run under a specific identity and roles are used to allow access to the
component.

I need to determine the user ID that made the call to the method.  I haven't
found a way to determine who made the call, from within the ActiveX DLL.

The COM+ application is called by both ASP and VB 6.0 applications.

Any help is appreciated.

Thanks
devmo - 28 Jun 2005 22:55 GMT
I have found the GetSecurityCallContext to be part of what I'm in need, but
I'm having trouble getting this to work.

In order to test, but the DLL be running under COM+?  I'd like to understand
how to have it run under COM+ but still debug.
>I have a DLL running as a COM+ application.  The application is configured
>to run under a specific identity and roles are used to allow access to the
[quoted text clipped - 9 lines]
>
> Thanks
"Peter Huang" [MSFT] - 29 Jun 2005 07:42 GMT
Hi

Is this what you want?

NOTE: Add a reference to COM+ Type Library and ensure the dll is running
under COM+ context.

Public Function GetCallerName() As String
Dim fso As New FileSystemObject
Dim ts As TextStream
Set ts = fso.CreateTextFile("C:\COMPlusContextLog.txt", True, True)

ts.WriteLine ("Call in")
Dim scc As SecurityCallContext
Dim si As SecurityIdentity
Set si = GetSecurityCallContext("DirectCaller")
ts.WriteLine ("DirectCaller: " & si("AccountName"))
Set si = GetSecurityCallContext("OriginalCaller")
ts.WriteLine ("OriginalCaller: " & si("AccountName"))
ts.WriteLine ("Call out")

ts.Close

End Function

For detailed information refer to the doc below.
SecurityCallContext.Item
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html
/e6561b89-8af6-46cc-aeab-2b007d48fe26.asp
SecurityIdentity.Item
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cossdk/html
/5fecf9e1-3cc3-4671-8c4a-b925bde08c8d.asp

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
devmo - 29 Jun 2005 22:13 GMT
Yes,

this is exactly what i was looking for.  Thank you.
> Hi
>
[quoted text clipped - 37 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
devmo - 29 Jun 2005 22:14 GMT
How do you debug the dll when it is running in COM+ context?  In VB.NET you
can attach a process, can't you.  I'm curious if there is something that can
be done to step through the code while in the COM+ context.

> Hi
>
[quoted text clipped - 37 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
"Peter Huang" [MSFT] - 30 Jun 2005 08:29 GMT
Hi

I think VB6 IDE debuged COM+ it may cause some problems.
I think you may try to compile it with symbols and debug it via VC debugger.

How To Compile VB Programs with Debug Symbols Embedded (193133)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;193133

Also I think you may also try to use the Output to a file to do the debug.

Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.