Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-4596

AMQP: JMSSecurityExceptions are not propagated back to QPID client on authentication failures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.9.0
    • Broker
    • None

    Description

      I created a broker using a config file that contained:

      <simpleAuthenticationPlugin>
      <users>
      <authenticationUser username="system" password="systemPassword" groups="users,admins"/>
      <authenticationUser username="user" password="userPassword" groups="users"/>
      <authenticationUser username="guest" password="guestPassword" groups="guests"/>
      </users>
      </simpleAuthenticationPlugin>

      With a normal client, the following code will throw a JMSSecurityException on the connection.start(), or connection.createProducer(), or I assume on anything you do with connection. The same is true if I call createConnection with an unknown user, or a known user and invalid password

      ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost");
      Connection connection = factory.createConnection();
      connection.start();

      When I use the QPID client though, I don't get the JMSSecurityException. In the logs I can see the exception being thrown by the broker, but it doesn't get propagated back to the client, even if I add an exception listener. The code below will continue along until it hangs on the session.CreateProducer() call.

      ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", port, "admin", "password");
      Connection connection = factory.createConnection();
      connection.setExceptionListener(new ExceptionListener() {
      @Override
      public void onException(JMSException exception)

      { exception.printStackTrace(); }

      });
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      QueueImpl queue = new QueueImpl("queue://txqueue");
      MessageProducer p = session.createProducer(queue);

      I will attach a unit test that reproduces this.

      Attachments

        1. AMQ-4596.patch
          11 kB
          Kevin Anthony Earls
        2. AMQ-4596-partial.patch
          7 kB
          Kevin Anthony Earls
        3. AMQ-4596_updated.patch
          8 kB
          Kevin Anthony Earls
        4. AMQ-4596_final.patch
          22 kB
          Kevin Anthony Earls
        5. AMQ-4596_final_fixed.patch
          21 kB
          Kevin Anthony Earls

        Activity

          People

            tabish Timothy A. Bish
            kearls Kevin Anthony Earls
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: