You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jacob Rhoden <li...@jacobrhoden.com> on 2008/08/20 08:12:40 UTC

Enabling security

Hi,

Im new to activeMQ and am trying to work out how to do some basic
things. I want to at least enable some basic security so a password is
required before a que can be accessed. However enabling security breaks
the admin application, and errors continually appear in the log.

This is what I added to the activemq.xml file:
     <plugins>
         <simpleAuthenticationPlugin>
             <users>
             <authenticationUser
                     username="test" password="test"
                     groups="users,admins"/>
             </users>
	</simpleAuthenticationPlugin>
     </plugins>

I attemted to edit some files in the Admin applications WEB-INF to
include the usernamepassword however it alludes me what to put in there
after a few hours of google searching and reading.

Regards,
Jacob

---
Jacob Rhoden
Systems Development and Integration
Enterprise Applications
Information Services

University of Melbourne
Level 2, 258 Queensberry Street
Carlton Victoria, 3051

Mobile:  +61 4 1095 7575
Direct:  +61 3 8344 2884
Fax:     +61 3 8344 2885



Re: Enabling security

Posted by Jacob Rhoden <li...@jacobrhoden.com>.
Dejan Bosanac wrote:
> what kind of exception are you getting?
>
>   
I did a fresh clean install, setup the security using settings as 
described in your previous email. The admin web application now works 
fine. The whole thing appears to work fine. Except this appears on 
stdout, every few seconds. Any thoughts? I would love to be able to turn 
security on.

WARN  TransportConnection            - Failed to add Connection
java.lang.SecurityException: User name or password is invalid.
        at 
org.apache.activemq.security.SimpleAuthenticationBroker.addConnection(SimpleAuthenticationBroker.java:52)
        at 
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:88)
        at 
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:662)
        at 
org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:86)
        at 
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:125)
        at 
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
        at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:180)
        at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143)
        at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206)
        at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at 
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196)
        at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
        at java.lang.Thread.run(Thread.java:619)


Re: Enabling security

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Hi,

if you need a <camelContext> with the secured broker, you must set the
appropriate ActiveMQComponent as shown in the patch for AMQ-1237
(https://issues.apache.org/activemq/browse/AMQ-1237)

Cheers

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net



Joe Fernandez wrote:
> Here's a link to Camel, which btw is very cool ;)
>
> http://activemq.apache.org/camel/
>
> If you don't intend to use Camel, then there's no problem removing the
> <camelContext>.
>
> Joe
> http://www.ttmsolutions.com
>
>
> Jacob Rhoden-4 wrote:
>   
>> Dejan Bosanac wrote:
>>     
>>> what kind of exception are you getting?
>>>
>>>   
>>>       
>> I finally worked it out, if you add security using the simple security 
>> plugin. Simply remove the <camelContext> part from the configuration 
>> file to prevent the exceptions. Until I work out what this does, ill 
>> just hope its not important. (:
>>
>> Best Regards,
>> Jacob
>>
>>
>>     
>
>   



Re: Enabling security

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
Here's a link to Camel, which btw is very cool ;)

http://activemq.apache.org/camel/

If you don't intend to use Camel, then there's no problem removing the
<camelContext>.

Joe
http://www.ttmsolutions.com


Jacob Rhoden-4 wrote:
> 
> Dejan Bosanac wrote:
>> what kind of exception are you getting?
>>
>>   
> I finally worked it out, if you add security using the simple security 
> plugin. Simply remove the <camelContext> part from the configuration 
> file to prevent the exceptions. Until I work out what this does, ill 
> just hope its not important. (:
> 
> Best Regards,
> Jacob
> 
> 

-- 
View this message in context: http://www.nabble.com/Enabling-security-tp19063428p19080962.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Enabling security

Posted by Jacob Rhoden <li...@jacobrhoden.com>.
Dejan Bosanac wrote:
> what kind of exception are you getting?
>
>   
I finally worked it out, if you add security using the simple security 
plugin. Simply remove the <camelContext> part from the configuration 
file to prevent the exceptions. Until I work out what this does, ill 
just hope its not important. (:

Best Regards,
Jacob

Re: Enabling security

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Hi Jacob,

what kind of exception are you getting?

Regards

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net




Jacob Rhoden wrote:
> Dejan Bosanac wrote:
>> you have to provide credentials to the connectionFactory bean in
>> webapps/admin/WEB-INF/webconsole-embedded.xml
>>
>> such as
>>
>>    <bean id="connectionFactory"
>> class="org.apache.activemq.ActiveMQConnectionFactory">
>>      <property name="brokerURL" value="vm://localhost"/>
>>      <property name="userName" value="test"/>
>>      <property name="password" value="test"/>      </bean>
>>
>> alternately, you can take a look at patch for issue 1237
>> (https://issues.apache.org/activemq/browse/AMQ-1237)
>>   
> This is exactly what I did, however it didn't work, it must be
> something stupid I am doing. I will try this again. Thanks for your
> help! Fixing this in 5.2 will be a great addition for newbies.
>
> Best Regards,
> Jacob
>



Re: Enabling security

Posted by Jacob Rhoden <li...@jacobrhoden.com>.
Dejan Bosanac wrote:
> you have to provide credentials to the connectionFactory bean in
> webapps/admin/WEB-INF/webconsole-embedded.xml
>
> such as
>
>    <bean id="connectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>      <property name="brokerURL" value="vm://localhost"/>
>      <property name="userName" value="test"/>
>      <property name="password" value="test"/>   
>    </bean>
>
> alternately, you can take a look at patch for issue 1237
> (https://issues.apache.org/activemq/browse/AMQ-1237)
>   
This is exactly what I did, however it didn't work, it must be something 
stupid I am doing. I will try this again. Thanks for your help! Fixing 
this in 5.2 will be a great addition for newbies.

Best Regards,
Jacob

Re: Enabling security

Posted by Dejan Bosanac <de...@ttmsolutions.com>.
Hi,


you have to provide credentials to the connectionFactory bean in
webapps/admin/WEB-INF/webconsole-embedded.xml

such as

   <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
     <property name="brokerURL" value="vm://localhost"/>
     <property name="userName" value="test"/>
     <property name="password" value="test"/>   
   </bean>

alternately, you can take a look at patch for issue 1237
(https://issues.apache.org/activemq/browse/AMQ-1237)

Cheers

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net




Jacob Rhoden wrote:
> Hi,
>
> Im new to activeMQ and am trying to work out how to do some basic
> things. I want to at least enable some basic security so a password is
> required before a que can be accessed. However enabling security breaks
> the admin application, and errors continually appear in the log.
>
> This is what I added to the activemq.xml file:
>     <plugins>
>         <simpleAuthenticationPlugin>
>             <users>
>             <authenticationUser
>                     username="test" password="test"
>                     groups="users,admins"/>
>             </users>
>     </simpleAuthenticationPlugin>
>     </plugins>
>
> I attemted to edit some files in the Admin applications WEB-INF to
> include the usernamepassword however it alludes me what to put in there
> after a few hours of google searching and reading.
>
> Regards,
> Jacob
>
> ---
> Jacob Rhoden
> Systems Development and Integration
> Enterprise Applications
> Information Services
>
> University of Melbourne
> Level 2, 258 Queensberry Street
> Carlton Victoria, 3051
>
> Mobile:  +61 4 1095 7575
> Direct:  +61 3 8344 2884
> Fax:     +61 3 8344 2885
>
>
>