Configure security for message-driven beans

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 needs to be configured with a RunAs identity deployment descriptor. Security depends on the role specified by the RunAs Iidentity for the message-driven bean as an EJB component. For more information, see the Secure enterprise bean applications during assembly topic in Security.

JMS connections used by message-driven beans can benefit from the added security of using J2C container-managed authentication. To enable the use of J2C container authentication aliases and mapping, define a J2C container-managed alias on the JMS connection factory definition that the MDB is using to listen upon (defined by the Connection factory JNDI name property of the listener port). If defined, the listener uses the container-managed authentication alias for its JMSConnection security credentials instead of any application-managed alias. To set the container-managed alias, use the administrative console to complete these following steps:

  1. To display the listener port settings, click Servers --> appserver --> Message Listener Service --> Listener Ports --> listener_port.
  2. To get the name of the JMS connection factory, look 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 provided by the embedded WebSphere JMS provider, click Resources --> WebSphere JMS Provider . Then, under Additional Properties, click WebSphere Queue Connection Factories --> connection_factory
  4. Set the Container-managed Authentication Alias property.