Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 91980 invoked from network); 14 Dec 2006 07:34:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 07:34:53 -0000 Received: (qmail 50572 invoked by uid 500); 14 Dec 2006 07:35:00 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 50561 invoked by uid 500); 14 Dec 2006 07:35:00 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 50549 invoked by uid 99); 14 Dec 2006 07:35:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 23:35:00 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.235.254.11] (HELO exodus.exist.com) (209.235.254.11) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Dec 2006 23:34:48 -0800 Received: from [192.168.241.162] ([58.71.13.205]) (authenticated bits=0) by exodus.exist.com (8.13.1/8.13.1) with ESMTP id kBE7YDsE021719 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Dec 2006 02:34:17 -0500 Message-ID: <4580FE7B.5000203@exist.com> Date: Thu, 14 Dec 2006 15:34:19 +0800 From: Adrian Co User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: activemq-users@geronimo.apache.org Subject: Re: How can I enable principle and credentials for embedded broker? References: <20061214072251.16693.qmail@web38911.mail.mud.yahoo.com> In-Reply-To: <20061214072251.16693.qmail@web38911.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 > 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 > >