activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Sadik Kumlali <as_kuml...@yahoo.com>
Subject Re: How can I enable principle and credentials for embedded broker?
Date Thu, 14 Dec 2006 11:53:01 GMT
It works! Thanks a lot Adrian. 

With the help of improvement issue[1], anyone who may need the same thing can follow the steps
below:

- Download activemq-jaas-x.x.x.jar and add to the CLASSPATH
- Create conf directory and add to the CLASSPATH
- Put login.config into conf directory
- Put users.properties and  groups.properties into conf\org\apache\activemq\security
- Use following code for initializing the embedded broker

------------------------------------------------------


// Server initialization
BrokerService broker = new BrokerService();
broker.addConnector("tcp://localhost:61616");
broker.setPlugins(new BrokerPlugin[] { new JaasAuthenticationPlugin () });    


broker.start();
------------------------------------------------------


Regards,

Ali Sadik Kumlali


[1] http://issues.apache.org/activemq/browse/AMQ-982

----- Original Message ----
From: Adrian Co <aco@exist.com>
To: activemq-users@geronimo.apache.org
Sent: Thursday, December 14, 2006 9:34:19 AM
Subject: Re: How can I enable principle and credentials for embedded broker?

Oh! I'm sorry, I meant setPlugins. :)

Ali Sadik Kumlali wrote:
> Thank you Adrian. But I couldn't find addPlugins() method of BrokerService[1]. It seems
I misunderstood you :)
>
>
> [1] http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java?view=markup
>
> ----- Original Message ----
> From: Adrian Co <aco@exist.com>
> To: activemq-users@geronimo.apache.org
> Sent: Thursday, December 14, 2006 4:21:12 AM
> Subject: Re: How can I enable principle and credentials for embedded broker?
>
> I'd try using broker.addPlugins() and instantiate the different broker 
> plugins available.
>
> Ali Sadik Kumlali wrote:
>   
>> Hi folks,
>>
>> I've been walking through the documentation, mailing list and Google for a while
but couldn't get a solution to my problem.
>>
>> I need to;
>> 1) Use embedded broker
>> 2) Access initial context by providing username(SECURITY_PRINCIPAL) and password(SECURITY__CREDENTIALS)
>> 3) Create connections by providing username and password
>>  
>> For standalone case, I managed to do 3) by following the instructions[1]. But couldn't
find a way for 2) either.
>>
>> Here is the code snippet:
>>
>> ----------------------------------------------
>> // Server initialization
>> BrokerService broker = new BrokerService();
>> broker.addConnector("tcp://localhost:61616");
>> broker.start();
>>
>>
>> // Client initialization
>> Properties props = new Properties();
>> props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory");
>> props.setProperty(Context.PROVIDER_URL,"tcp://localhost:61616");
>> props.setProperty(Context.SECURITY_PRINCIPAL, "contextUser");
>> props.setProperty(Context.SECURITY__CREDENTIALS, "contextPassword");
>>
>> Context jndiContext = new InitialContext(props);
>> ...
>> Connection connection = connectionFactory.createConnection("connUser", "connPassword");
>> ----------------------------------------------
>>
>>
>> Now, how can I configure embedded broker to make it require contextUser, contextPassword,
connUser and connPassword?
>>
>> Any help would be appreciated.
>>
>> Regards,
>>
>> Ali Sadik Kumlali
>>
>>
>> [1] http://www.activemq.org/site/security.html
>>
>>
>>
>>
>>
>>
>>
>>  
>> ____________________________________________________________________________________
>> Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it now.
>>
>>   
>>     
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
>
>   





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message