Designing for Security
Your end-to-end strategy for security obviously depends on the type of distributed application you are developing. Here are several suggestions for addressing security with respect to middle-tier application logic.
- Authenticate as close to the user as you can for efficiency and performance. If your application involves a browser-to-business-logic-to-database architecture, consider mapping the browser clients to domain identities, run the COM+ application under identities specific to each application, and secure tables in the back end to only be accessed by a particular application identity. This trusted server scenario is more scalable and less problematic than using the back end DBMS for authenticating.
- If you are designing a component that will be used in a distributed application using role-based security, you can use COM+ programmatic security. This functionality allows you to protect blocks of code from unauthorized access by calling methods such as IsCallerInRole and IsSecurityEnabled. You can also use the security call context to get information about an object's callers. For more information, see Programming Component Security.
- If you are designing a component that will be used in a distributed application without using role-based security, then security is automatically checked only at the process level. Process access permissions determine who is given access to the application. If you need finer grain control over security settings at the process or at the interface level, use the programmatic security functionality provided by COM.
- If a component using COM+ programmatic security is run without being integrated into a COM+ application, exceptions will be thrown. Therefore, if you want to ensure that such a component is also capable of being successfully integrated into an application that is not part of the COM+ environment, you must handle all exceptions appropriately.