activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wallace <wallace3...@yahoo.com>
Subject Re: ActiveMQConnectionFactory username/password question
Date Mon, 11 Sep 2006 23:51:35 GMT

Thanks for the pointer. I am actually integrating activemq with jboss. 

What I am trying archieve is,
1) define valid username/password pair(s) in jboss, probably in
application-policy
2) send amessage to a topic in code,probably servlet, running within jboss
3) a standalone consumer app listening to the broker should not be able to
creation connection unless it passes the right username/password to create
connection

I've tried the following approaches 

a) Use default
<security-domain-and-application>JmsXARealm</security-domain-and-application>
for the topic in -ds.xml

result : both connectionFactory.createTopicConnection() and 
                   connectionFactory.createTopicConnection("guest", "guest")
gave the classic principal=null error

b) use an application-polcy like

    <application-policy name = "activemq-domain">
       <authentication>
          <login-module code = "org.jboss.security.ClientLoginModule"
             flag = "required">
             <module-option name = "principal">guest</module-option>
             <module-option name = "userName">guest</module-option>
             <module-option name = "password">guest</module-option>
             <module-option name =
"managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
          </login-module>
       </authentication>
    </application-policy>

result: the listening app can still get messages from the topic with passing
junks to the createConnection function.

Do I miss something here?

Thanks,
-Wallace


James.Strachan wrote:
> 
> On 9/11/06, wallace <wallace3000@yahoo.com> wrote:
>>
>> I am using activemq 4.0  and running the examples. It seems no matter if
>> I am
>> running the topic/queue, persist/non-persistent, durable/non-durable.
>> Username and password do not seem to matter.
> 
> The default out of the box install doesn't use a security plugin to
> restrict access.
> 
> For an example see...
> 
> http://incubator.apache.org/activemq/security.html
> 
> James
> 
>>
>> I changed the createConnection() function to two separate functions for
>> producer and consumer
>>
>>     protected Connection createConnection-rpoducer() throws JMSException,
>> Exception {
>>         ActiveMQConnectionFactory connectionFactory = new
>> ActiveMQConnectionFactory("producer-username", "producer-passwd", url);
>>     ..........
>>
>>     protected Connection createConnection-consumer() throws JMSException,
>> Exception {
>>         ActiveMQConnectionFactory connectionFactory = new
>> ActiveMQConnectionFactory("consumer-username", "consumer-passwd", url);
>>    ..........
>>
>>
>> Why does it seem like the example would run even if I use different
>> username
>> and password for producer and consumer?
>>
>> Thank you,
>> -Wallace Wong
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ActiveMQConnectionFactory-username-password-question-tf2250509.html#a6241697
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQConnectionFactory-username-password-question-tf2250509.html#a6257410
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message