<!— <application-policy name=”jbossmq”> <authentication> <login-module code=”org.jboss.security.auth.spi.DatabaseServerLoginModule” flag=”required”> <module-option name=”dsJndiName”>java:/DefaultDS</module-option> <module-option name=”principalsQuery”>SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option> <module-option name=”rolesQuery”>SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option> </login-module> </authentication> </application-policy> —> <application-policy name=”jbossmq”> <authentication> <login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule” flag=”required”> <module-option name=”usersProperties”> props/sas-jms-users.properties</module-option> <module-option name=”rolesProperties”> props/sas-jms-roles.properties</module-option> </login-module> </authentication> </application-policy>
<!— <application-policy name=”jbossmq”> <authentication> <login-module code=”org.jboss.security.auth.spi.DatabaseServerLoginModule” flag=”required”> <module-option name=”dsJndiName”> java:/DefaultDS</module-option> <module-option name=”principalsQuery”>SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option> <module-option name=”rolesQuery”>SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option> </login-module> </authentication> </application-policy> —> <application-policy name=”jbossmq”> <authentication> <login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule” flag=”required”> <module-option name=”usersProperties”> props/sas-jms-users.properties</module-option> <module-option name=”rolesProperties”> props/sas-jms-roles.properties</module-option> </login-module> </authentication> </application-policy>
<application-policy name=”JmsXARealm”> <authentication> <login-module code=”org.jboss.resource.security. ConfiguredIdentifyLoginModule” flag=”required”> <module-option name=”principal”>sasjms</module-option> <module-option name=”userName”>sasjms</module-option> <module-option name=”password”>EaSyPasWd71</module-option> <module-option name=”managedConnectionFactoryName”> jboss.jca:service=TxCM,name=JmsXA</module-option> </login-module> </authentication> </application-policy>
<application-policy name=”JmsXARealm”> <authentication> <login-module code=”org.jboss.resource.security.ConfiguredIdentifyLoginModule” flag=”required”> <module-option name=”principal”>sasjms</module-option> <module-option name=”userName”>sasjms</module-option> <module-option name=”password”>EaSyPasWd71</module-option> <module-option name=”managedConnectionFactoryName”> jboss.jca:service=TxCM,name=JmsXA</module-option> </login-module> </authentication> </application-policy>
JBoss-installation-directory\server\SASServer1\conf\jboss-service.xml
file, replace
the guest role with the role that was defined in the roles.properties
file for ConnectionFactories, AlertQueue, and WorkflowQueue. The following
code assumes that the JMSUser role is defined in the sas–jms–roles.properties
file.
<mbean code=”org.jboss.naming.LinkRefPairService” name=”jboss.jms:alias=SASTopicConnectionFactory”> <attribute name=”JndiName”>sas/jms/TopicConnectionFactory</attribute> <attribute name=”RemoteJndiName”>ConnectionFactory</attribute> <attribute name=”LocalJndiName”>java:/JmsXA</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> <depends>jboss:service=Naming</depends> </mbean> <mbean code=”org.jboss.naming.LinkRefPairService” name=”jboss.jms:alias=SASQueueConnectionFactory”> <attribute name=”JndiName”>sas/jms/QueueConnectionFactory</attribute> <attribute name=”RemoteJndiName”>ConnectionFactory</attribute> <attribute name=”LocalJndiName”>java:/JmsXA</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> <depends>jboss:service=Naming</depends> </mbean> <mbean code=”org.jboss.mq.server.jmx.Queue” name=”jboss.mq.destination:service=Queue,name=AlertQueue”> <depends optional-attribute-name=”DestinationManager”> jboss.mq:service=DestinationManager</depends> <attribute name=”JndiName”>sas/jms/AlertQueue</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> </mbean> <mbean code=”org.jboss.mq.server.jmx.Queue” name=”jboss.mq.destination:service=Queue,name=WorkflowQueue”> <depends optional-attribute-name=”DestinationManager”> jboss.mq:service=DestinationManager</depends> <attribute name=”JndiName”>sas/jms/WorkflowQueue</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> </mbean>
<mbean code=”org.jboss.naming.LinkRefPairService” name=”jboss.jms:alias=SASTopicConnectionFactory”> <attribute name=”JndiName”>sas/jms/TopicConnectionFactory</attribute> <attribute name=”RemoteJndiName”>ConnectionFactory</attribute> <attribute name=”LocalJndiName”>java:/JmsXA</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> <depends>jboss:service=Naming</depends> </mbean> <mbean code=”org.jboss.naming.LinkRefPairService” name=”jboss.jms:alias=SASQueueConnectionFactory”> <attribute name=”JndiName”>sas/jms/QueueConnectionFactory</attribute> <attribute name=”RemoteJndiName”>ConnectionFactory</attribute> <attribute name=”LocalJndiName”>java:/JmsXA</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> <depends>jboss:service=Naming</depends> </mbean> <mbean code=”org.jboss.mq.server.jmx.Queue” name=”jboss.mq.destination:service=Queue,name=AlertQueue”> <depends optional-attribute-name=”DestinationManager”> jboss.mq:service=DestinationManager</depends> <attribute name=”JndiName”>sas/jms/AlertQueue</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> </mbean> <mbean code=”org.jboss.mq.server.jmx.Queue” name=”jboss.mq.destination:service=Queue,name=WorkflowQueue”> <depends optional-attribute-name=”DestinationManager”> jboss.mq:service=DestinationManager</depends> <attribute name=”JndiName”>sas/jms/WorkflowQueue</attribute> <security> <role name=”JMSUser” read=”true” write=”true” /> </security> </mbean>
JBoss-installation-directory\server\SASServer1\deploy\jms\jbossmq-service.xml
file, replace the guest role with the role that was defined in the
roles.properties file for ConnectionFactories, AlertQueue, and WorkflowQueue.
The following code assumes that the JMSUser role is defined in the
sas–jms–roles.properties file.
<mbean code=”org.jboss.mq.security.SecurityManager” name=”jboss.mq:service=SecurityManager”> <attribute name=”DefaultSecurityConfig”> <security> <role name=”JMSUser” read=”true” write=”true” create=”true” /> </security> </attribute> <attribute name=”SecurityDomain”>java:/jaas/jbossmq</attribute> <depends optional-attribute-name=”NextInterceptor”> jboss.mq:service=DestinationManager</depends> </mbean>
<mbean code=”org.jboss.mq.security.SecurityManager” name=”jboss.mq:service=SecurityManager”> <attribute name=”DefaultSecurityConfig”> <security> <role name=”JMSUser” read=”true” write=”true” create=”true” /> </security> </attribute> <attribute name=”SecurityDomain”>java:/jaas/jbossmq</attribute> <depends optional-attribute-name=”NextInterceptor”> jboss.mq:service=DestinationManager</depends> </mbean>