Configure security for EJB 2.1 message-driven beans
Overview
Use this task to configure resource security and security permissions for EJB V2.1 message-driven beans.
The association between connection factories, destinations, and MDBs is provided by listener ports, which allows a deployed MDB bean associated with the port to retrieve messages from the associated destination.
You create listener ports by specifying their administrative name, the connection factory JNDI name, and the destination name (other optional properties are also configurable). Listener ports provide simplified administration of the associations between connection factories, destinations and MDBs, and are managed by a listener manager. The listener manager is provided by the message listener service to control and monitor the JMS listeners that are monitoring JMS destinations on behalf of deployed MDBs.
Messages handled by MDBs have no client credentials associated with them. The messages are anonymous.
To call secure enterprise beans from a MDB bean, the MDB bean needs to be configured with a RunAs Identity deployment descriptor. Security depends on the role specified by the RunAs Identity for the MDB bean as an EJB component.
Connections used by MDBs can benefit from the added security of using J2C container-managed authentication. To enable the use of J2C container authentication aliases and mapping, define an authentication alias on the J2C activation specification that the MDB bean is configured with. If defined, the MDB bean uses the authentication alias for its JMSConnection security credentials instead of any application-managed alias.
To set the authentication alias, you can use the administrative console to complete the following steps. This task description assumes that you have already created an activation specification.
Procedure
- For a MDB bean listening on a JMS destination of the default messaging provider, set the authentication alias on a JMS activation specification.
- To display the JMS activation specification settings, click...
Resources > JMS Providers > Default messaging > [Activation Specifications] JMS activation specification
- If you have already created a JMS activation specification, click its name in the list displayed. Otherwise, click New to create a new JMS activation specification.
- Set the Authentication alias property.
- Click OK
- Save your changes to the master configuration.
- For a MDB bean listening on a destination (or endpoint) of another JCA provider, set the authentication alias on a J2C activation specification.
- To display the J2C activation specification settings, click...
Resources > Resource Adapters > adapter_name > J2C Activation specifications > activation specification_name
- Set the Authentication alias property.
- Click OK
- Save your changes to the master configuration.
Configure a JMS activation specification for MDBs used by the default messaging provider