Hello Joe,

thank you for your fast reply.

The problem is, that I don't use ActiveMQ 5 but ActiveMQ 4. So the
XML-Schema for the configfile is a different one and does not support this
type of configuration of a simpleAuthenticationPlugin.

But now i found out, how it works for ActiveMQ 4: 

<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:amq="http://activemq.org/config/1.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:util="http://www.springframework.org/schema/util";
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.org/config/1.0
http://activemq.apache.org/schema/activemq-core.xsd
  http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>

        <!-- Allows us to use system properties as variables in this 
configuration
file -->
        <bean
        
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>

        <broker xmlns="http://activemq.org/config/1.0";
                brokerName="localhost">

                <amq:plugins>
                        <amq:simpleAuthenticationPlugin userGroups="#groups"
                                userPasswords="#users"/>
                </amq:plugins>

        </broker>

        <util:map id="users">
                <entry key="user1" value="password1" />
        </util:map>
        <util:map id="groups">
                <entry key="user1">
                        <ref bean="group1" />
                </entry>
        </util:map>
        <util:set id="group1"></util:set>

</beans>

At the moment, I'm have no idea about JAAS, but I think i should learn and
use it with ActiveMQ and also update to ActiveMQ 5.

Thank you very much,
Rudi



ttmdev wrote:
> 
> You can point your broker to an xml configuration file, which includes a
> simpleAuthenticationPlugin as follows.
> 
> <plugins>
>  <!--  use the simpleAuthenticationPlugin instead of JAAS -->
>  <simpleAuthenticationPlugin>
>    <!-- Define all users along with their passwords and the groups -->
>   <users>
>     <authenticationUser 
>           username="system"
>           password="manager"
>           groups="users,admins"/>
>    <authenticationUser
>           username="user"
>           password="password"
>         groups="users"/>
>     <authenticationUser
>           username="guest"
>           password="password"
>           groups="guests"/>
>   </users>
>  </simpleAuthenticationPlugin>
> </plugins>
> 
> Also see http://activemq.apache.org/security.html
> 
> Joe
> 
> 
> 
> Rudi23 wrote:
>> 
>> Hello,
>> 
>> in my application I start an embedded broker as follows:
>> 
>> BrokerService broker = new BrokerService();
>> broker.addConnector("tcp://localhost:61616");
>> broker.start();
>> 
>> The broker starts up and I can use it both on localhost and remote.
>> Everything is fine so far.
>> 
>> Now I would like to enforce an authentication of the clients.
>> At the moment I'm using connectionFactory.createConnection(); on the
>> client to get a connection to the broker. 
>> Can you tell me, how I must configure the broker, so that the client must
>> use connectionFactory.createConnection(String username, String password);
>> to obtain a connection?
>> 
>> 
>> Thank you in advance,
>> Rudi
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Authentication-of-clients-tp15016858s2354p15061934.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to