1 Reply Latest reply on Sep 26, 2012 7:27 AM by dejanb_dejan

    JAAS Username/Password Authentication error

    hdcosta

      I followed the documentation at http://fusesource.com/docs/esbent/7.0/amq_security/Auth-JAAS-AuthentPlugin.html . No authorization setup yet.

       

      I have my login.config and users.properties files in a custom directory that I have specified via the java.security.auth.login.config system property (set in bin/setenv in KARAF_OPTS that gets passed to the start script).

       

      When the broker is started there is no indication in the log that the authentication plugin has loaded or taken effect. Is there any way to debug this?

       

      When I query a queue in the standalone webconsole, the broker log does print the username, that proves that the credentials are being sent from the webconsole and received by the broker.

       

      2012-08-16 17:15:13,868 | WARN  | /127.0.0.1:49035 | TransportConnection              | 120 - org.apache.activemq.activemq-core - 5.5.1.fuse-7-061 | Failed to add Connection ID:xxxxxxx-56628-1345162513739-2:1, reason: java.lang.SecurityException: User name or password is invalid.

      2012-08-16 17:15:13,878 | WARN  | /127.0.0.1:49035 | Transport                        | 120 - org.apache.activemq.activemq-core - 5.5.1.fuse-7-061 | Transport Connection to: tcp://127.0.0.1:49035 failed: java.io.EOFException

      2012-08-16 17:15:15,869 | INFO  | ActiveMQ Task-4  | TransportConnection              | 120 - org.apache.activemq.activemq-core - 5.5.1.fuse-7-061 | Stopping tcp://127.0.0.1:49035 because Failed with SecurityException: User name or password is invalid.

       

       

      However in the webconsole log, there is an error

       

      Aug 16, 2012 5:15:13 PM org.apache.catalina.core.StandardWrapperValve invoke

      SEVERE: Servlet.service() for servlet in context with path /activemqweb threw exception [org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'queueBrowser' defined in ServletContext resource /WEB-INF/webconsole-query.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class : Constructor threw exception; nested exception is javax.jms.JMSException: User name or password is invalid.] with root cause

      javax.security.auth.login.LoginException: No LoginModules configured for xxxxxxxxxx

              at javax.security.auth.login.LoginContext.init(LoginContext.java:256)

              at javax.security.auth.login.LoginContext.(LoginContext.java:403)

              at org.apache.activemq.security.JaasAuthenticationBroker.addConnection(JaasAuthenticationBroker.java:75)

              at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)

              at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:699)

              at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:77)

              at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)

              at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:291)

              at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:149)

              at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)

              at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)

              at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:229)

              at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)

              at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:215)

              at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:197)

              at java.lang.Thread.run(Thread.java:662)

       

      I found another thread in the Fuse Message Broker forum from 2009 titled "Simple JAAS Authentication/Authorization" that raises the same issue.

        • 1. Re: JAAS Username/Password Authentication error
          dejanb_dejan

          Hi,

           

          as the broker is now secured you need to configure the web console to access the secured broker. You can do that by putting something like this to etc/system.properties

          (Note that you need to configure both jmx and jms access)

           

           

          activemq.port = 61616

          activemq.host = localhost

          activemq.url = tcp://${activemq.host}:${activemq.port}

           

           

          activemq.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-${karaf.name}

          activemq.jmx.user=fusemq

          activemq.jmx.password=fusemq

           

           

          webconsole.type=properties

          webconsole.jms.url=${activemq.url}

          webconsole.jmx.url=${activemq.jmx.url}

          webconsole.jmx.user=fusemq

          webconsole.jmx.password=fusemq

          webconsole.jms.user=fusemq

          webconsole.jms.password=fusemq

           

          Edited by: dejanb on Sep 26, 2012 1:26 PM