The ACTIVEMQ is divided into the control terminal and the client, the following describes the security authentication configuration method respectively.
1. Control-Side Security Configuration
(1). ACTIVEMQ Directory conf jetty.xml found:
<BeanID= "Securityconstraint"class= "Org.eclipse.jetty.util.security.Constraint"> < Propertyname= "Name"value= "BASIC" /> < Propertyname= "Roles"value= "User,admin" /> <!--set Authenticate=false to disable login - < Propertyname= "Authenticate"value= "true" /></Bean>
Meaning:
<property name= "Authenticate" value= "true"/> true: Authentication required; False: No Authentication required
(2). ACTIVEMQ Directory conf found jetty-realm.properties
# Username:password [, rolename ...] admin:admin123, Adminuser:user, user
Description
The first admin, for the authentication user name.
The second admin123 is the authentication password.
The third admin, for the role.
(3). Restart ACTIVEMQ Verify that authentication is required
After restarting Activemq, Access: http://127.0.0.1:8161/admin/, pop up the HTTP Basic Authentication box, this time the authentication takes effect.
1. Client Security Configuration
(1). Unzip the directory/conf/activemq.xml add: Broken
<Plugins> <!--Use Jaas to authenticate using the Login.config file on the classpath to configure JAAS - <JaasauthenticationpluginConfiguration= "Activemq" /> <!--lets configure a destination based authorization mechanism - <Authorizationplugin> <Map> <Authorizationmap> <authorizationentries> <AuthorizationentryTopic= ">"Read= "admins"Write= "admins"Admin= "admins" /> <AuthorizationentryQueue= ">"Read= "admins"Write= "admins"Admin= "admins" /> <AuthorizationentryTopic= "Activemq.advisory.>"Read= "admins"Write= "admins"Admin= "admins"/> <AuthorizationentryQueue= "Activemq.advisory.>"Read= "admins"Write= "admins"Admin= "admins"/> </authorizationentries> </Authorizationmap> </Map> </Authorizationplugin> </Plugins>
If the cluster continues to be added in broken:
< networkconnectors > < userName= "User name" password= "password" uri= "Static: (tcp:// localhost:61616) " duplex=" true "/> </ Networkconnectors>
(2). Unzip the directory/conf/login.config:
activemq{ org.apache.activemq.jaas.PropertiesLoginModule required debug=true Org.apache.activemq.jaas.properties.user= "Users.properties" org.apache.activemq.jaas.properties.group= " Groups.properties ";};
(3). Unzip the directory/conf/groups.properties:
admins= User Name
(4). Unzip the directory/conf/users.properties:
User name = password
Message middleware activemq-5.13.0 Security authentication Configuration