Security
ACTIVEMQ supports pluggable security mechanisms for switching between different provider. For example, JAAS authentication Plugin,custom authentication Implementation,authorization Plugin
The following is an example of Jaas authentication plugin.
The Jaas authentication plugin relies on the standard JAAS mechanism to implement authentication. In general, you need to configure the login modules configuration file by setting the Java.security.auth.login.config system properties. If this system attribute is not specified, then the JAAS authentication plugin uses login.config as the file name by default.
To the official website http://activemq.apache.org/Download ACTIVEMQ release, the current activeMQ5.11 need JDK7 support, the following to Activemq5.9+jdk6 as an example. Open the Conf folder as follows
1. Open File Login.config,
[HTML] view plain copy activemq-domain {org.apache.activemq.jaas.PropertiesLoginModule required Org.apache.activemq.jaas.properties.user= "Users.properties" org.apache.activemq.jaas.properties.group= " Groups.properties "; };
Two properties are set in this Login.config file: Org.apache.activemq.jaas.properties.user and Org.apache.activemq.jaas.properties.group are used to point to user.properties, respectively.
2. Open File Groups.properties
[HTML] view plain copy #格式: User group = user 1, user 2,... admins=system, Users=system,client,user guests=guest
3. Open File User.properties
[HTML] view plain copy #格式user =password system=pass0 user=pass1 guest=pass2
4. Open File Activemq.xml
[HTML] View Plain copy <plugins> <!--Use jaas to authenticate using the login.config file on the classpath to configure JAAS --> <jaasauthenticationplugin configuration= "Activemq-domain" /> <!-- lets configure a destination based authorization mechanism --> <authorizationPlugin> <map> <authorizationMap> < authorizationentries> <authorizationentry queue= "> " read=" admins " write=" admins " admin=" admins "