You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by wallace <wa...@yahoo.com> on 2006/09/11 08:29:56 UTC

ActiveMQConnectionFactory username/password question

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.

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.


Re: ActiveMQConnectionFactory username/password question

Posted by James Strachan <ja...@gmail.com>.
We don't yet have a security plugin for JBoss - though we welcome patches :)
http://incubator.apache.org/activemq/contributing.html

details of the current plugins available here
http://incubator.apache.org/activemq/security.html

On 9/12/06, wallace <wa...@yahoo.com> wrote:
>
> 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 <wa...@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.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: ActiveMQConnectionFactory username/password question

Posted by wallace <wa...@yahoo.com>.
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 <wa...@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.


Re: ActiveMQConnectionFactory username/password question

Posted by James Strachan <ja...@gmail.com>.
On 9/11/06, wallace <wa...@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/