HighTechTalks DotNet Forums  

Serviced Components & Role-Based Security

Dotnet Framework (Component Services) microsoft.public.dotnet.framework.component_services


Discuss Serviced Components & Role-Based Security in the Dotnet Framework (Component Services) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
carl_bevil@yahoo.com
 
Posts: n/a

Default Serviced Components & Role-Based Security - 08-22-2007 , 12:36 PM






Hello all. I've posted this on a few other newsgroups without any
luck; hopefully someone here can give me some clues on this issue.

I've written a serviced component in C# that interacts with some COM
components (in a separate process). All components are run on the same
machine (currently under the Administrator account). I've enabled role-
based security on the serviced component (at the component level)
through attributes in C#. This component implements the standard
IConnectionPointContainer interface. It looks like this:


In assembly.cs:


[assembly: ApplicationActivation(ActivationOption.Server)]
[assembly: ApplicationAccessControl(Value = true,

Authentication = AuthenticationOption.Integrity,

ImpersonationLevel = ImpersonationLevelOption.Identify,

AccessChecksLevel =
AccessChecksLevelOption.ApplicationComponent)]
[assembly: SecurityRole("MyRole")]


In the class's .cs file:


using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.EnterpriseServices;


[ComVisible(true)]
[ComponentAccessControl(true)]
[Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX")]
[ProgId("MyComponent.MyObject.1")]
public class MyObject: ServicedComponent, /* Other interfaces... */,
IConnectionPointContainer
{
[SecurityRole("MyRole")]
void IConnectionPointContainer.EnumConnectionPoints(out
IEnumConnectionPoints ppEnum)
{
// Implementation
}

[SecurityRole("MyRole")]
void IConnectionPointContainer.FindConnectionPoint(ref Guid
riid, out IConnectionPoint ppCP)
{
// Implementation
}

// Other interface implementations...
}


I can CoCreate my component using this IID, and call
IConnectionPointContainer's methods on it. However, if I have role-
based security enabled, the calls always fail with E_ACCESSDENIED. The
client code is run under a user account that is included within
"MyRole". In fact, the same client code can call other methods on this
component that are restricted to "MyRole". If I remove the role
restrictions from these specific methods (by commenting out the
SecurityRole attribute), it still does not work. If I turn off role-
based security on this component (by commenting out the
ComponentAccessControl attribute), it *does* work. So it seems there
is something odd going on with the IConnectionPointContainer interface
and role-based security.

One thing I am seeing is that IConnectionPointContainer does not
appear in the list of interfaces in the COM+ application GUI (in
Component Services) -- even though I am explicitly implementing the
interface and can CoCreate using that interface. I suspect this is
somehow related to my problem; maybe this interface is somehow being
treated "special" by the interop layer (I know that connection point
implementations are converted to .NET events, so I am guessing
something similar might happen with IConnectionPointContainers).
Although I tried this with the IEnumString interface as a test and had
the same problems; my guess is that all the interfaces in
System.Runtime.InteropServices.ComTypes have this issue.

Any ideas on what is going on here, or how I can fix it? I really
don't care if the interface appears in the COM+ application as long as
I can use it with the object. But the security problem is a real issue
for me. How can I get these methods to work properly with role-based
security?


Reply With Quote
  #2  
Old   
Darrell Sveistrup
 
Posts: n/a

Default Re: Serviced Components & Role-Based Security - 10-13-2007 , 02:23 AM






Open the Com+ Applications on your PC
Find your com+ object
Open the properties
Then select the security tab

Change the Authentication Level for calls to: None

Hope that helps



*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.