Configuring security for message-driven beans that use listener ports

For non-Java™ EE Connector Architecture (JCA) messaging providers, the association between connection factories, destinations, and message-driven beans is provided by listener ports. In this case, you can configure resource security and security permissions for message-driven beans by setting the container-managed alias. The MDB listener's security information is established when the MDB listener's JMS Connection is created.

Before you begin

A listener port allows a deployed message-driven bean associated with the port to retrieve messages from the associated destination. For more information about listener ports, see Message-driven beans - listener port components.

About this task

In most respects, the security for an MDB is identical to that for any other enterprise bean. For instance, access to JDBC resources and JCA resources (for example CICS®, IMS™) is handled in the same way as for an entity or session bean. Access to other JMS resources is also handled in the same way as for other enterprise beans. However, securing the MDB listener, which can be thought of as part of the application server infrastructure, is unique to MDBs. To secure the MDB listener, you configure authentication and authorization for the server to connect to a JMS provider and a Destination so that a message can be selected and so that the MDB can pass this message to its onMessage() method.

Your MDB onMessage() application code might not make additional JMS calls. However, if the MDB application code accesses additional JMS resources, this access is handled identically to JMS calls made by an entity or session EJB.

The MDB listener's security information is established when the MDB listener's JMS Connection is created. This is the typical JMS programming pattern. The properties used to configure the MDB listener's JMS connection factory are also used for specifying these security parameters. By configuring the Connection Factory mapped to in the Listener Port definition, you can control the security parameters used by the MDB listener. The JMS Connection used by a given MDB listener is obtained in the order of precedence based on the configuration of the JMS Connection Factory used by the Message Listener Service Listener Port onto which a given MDB is mapped. For example, if an MDB, mdb1 is mapped onto Listener Port mylp1 and mylp1 uses ConnectionFactory qcf1, you would configure qcf1 to control the configuration of mdb1's MDB listener. The order of precedence is:
  1. If a container-managed alias has been defined for this Connection Factory, the user ID associated with the container-managed alias is used in the Connection creation call, for example createQueueConnection(userid,password).
  2. If a component-managed alias has been defined for this Connection Factory, the userid associated with the component-managed alias is used.
  3. If neither alias is specified and the Connection Factory is defined in Bindings mode (that is, TransportType = "BINDINGS"), the server identity is used.
Note: The authentication aliases referred to here are those associated with the Connection Factory defined by the Administrator. No application resource reference is associated with the MDB listener and so no authentication alias has to be set at that level.

To set the container-managed alias, (if you elect that option), use the administrative console to complete the following steps:

Procedure

  1. Display the listener port settings, by clicking Servers > Server Types > WebSphere application servers > application_server > [Communications] Messaging > Message listener service > [Additional properties] Listener ports > listener_port
  2. Get the name of the JMS connection factory, by looking at the Connection factory JNDI name property.
  3. Display the JMS connection factory properties. For example, to display the properties of a queue connection factory, click Resources > JMS > Queue connection factories > queue_connection_factory .
  4. Set the "Container-managed authentication alias" property.
  5. Click OK

Results

What to do next

Invoking other EJBs

Messages arriving at a listener port have no client credentials associated with them. The messages are anonymous. To call secure enterprise beans from a message-driven bean, the message-driven bean must be configured with a RunAs Identity deployment descriptor. Security depends on the role specified by the RunAs Identity for the message-driven bean as an EJB component.

For more information about EJB security, see Securing enterprise bean applications. For more information about configuring security for your application, see Securing applications during assembly and deployment.




In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 11:50:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-iseries&topic=tmb_sec00
File name: tmb_sec00.html