ActiveMQ (5.10.0)-Configuring the Simple Authentication Plug-in

Source: Internet
Author: User

The easiest-to-secure the broker is through the use of authentication credentials placed directly in the broker ' s XML Configuration file. Such functionality is provided by the simple authentication plug-in that's part of ActiveMQ. The following listing provides an example of using this plug-in.

<Plugins>    <Simpleauthenticationplugin>        <Users>            <Authenticationuserusername= "Admin"Password= "Admin"groups= "Admins,publishers,consumers"/>            <Authenticationuserusername= "publisher"Password= "publisher"groups= "Publishers,consumers"/>            <Authenticationuserusername= "Consumer"Password= "Consumer"groups= "Consumers"/>            <Authenticationuserusername= "Guest"Password= "Guest"groups= "Guests"/>        </Users>    </Simpleauthenticationplugin></Plugins>

By using this-simple configuration snippet, the four users can now access ActiveMQ. Obviously, for authentication purposes, each user must has a username and a password. Additionally, the groups attribute provides a comma-separated list of groups to which the user belongs. This information was used for authorization purposes, as would be seen shortly.

The preceding exception is expected because a security plug-in are activated but the authentication credentials haven ' t yet been defined in the Publisher client. To fix this exception, modify the Publisher to add a username and password. The following snippet provides an example of this:

 private  String username = "Publisher ;  private  String Password = "publisher" ;  public  Publisher () throws   JMSException {Factory  = new   Activemqconnectionfactory (    Brokerurl);    Connection  = factory.createconnection (username, password);    Connection.start (); Session  = Connection.createsession (false      = Session.createproducer (null   );}

As the preceding snippet shows, the only necessary change was to define a username and a password that's then used as par Ameters to the CreateConnection () method.

Unfortunately, with the simple authentication plug-in, passwords is stored (and transferred) as clear text, which impacts The security of the broker. But even plain-text passwords prevent unauthorized clients from interacting with the broker, and in some
Environments this was all that's needed. Additionally, you can consider using the simple authentication plug-in in combination with the SSL transport, which would a t least solve the problem of sending plain passwords over the network.

ActiveMQ (5.10.0)-Configuring the Simple Authentication Plug-in

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.