Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 96052 invoked from network); 14 Dec 2006 11:53:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 11:53:26 -0000 Received: (qmail 34991 invoked by uid 500); 14 Dec 2006 11:53:33 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 34974 invoked by uid 500); 14 Dec 2006 11:53:33 -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 34965 invoked by uid 99); 14 Dec 2006 11:53:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 03:53:33 -0800 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.191.125.112] (HELO web38906.mail.mud.yahoo.com) (209.191.125.112) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 14 Dec 2006 03:53:22 -0800 Received: (qmail 96800 invoked by uid 60001); 14 Dec 2006 11:53:01 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=aXFQHKbw2uZMVwOju1F7cCi8J22HnIhayEWuGO7DZ4n6NlZqk6SKpiNNY0KAzyhAzOGhWShJbxEGz04wByIAQuaxB4wxLOd1qzl2sLF5h05BUKGYfHI5uUnXkK3P4TRFpNZ4ktKNBMJhJhaulH4HifeUV/8nEeJkLqt4s1HfZQc= ; Message-ID: <20061214115301.96798.qmail@web38906.mail.mud.yahoo.com> Received: from [212.252.214.206] by web38906.mail.mud.yahoo.com via HTTP; Thu, 14 Dec 2006 03:53:01 PST Date: Thu, 14 Dec 2006 03:53:01 -0800 (PST) From: Ali Sadik Kumlali Subject: Re: How can I enable principle and credentials for embedded broker? To: activemq-users@geronimo.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org It works! Thanks a lot Adrian. =0A=0AWith the help of improvement issue[1],= anyone who may need the same thing can follow the steps below:=0A=0A- Down= load activemq-jaas-x.x.x.jar and add to the CLASSPATH=0A- Create conf direc= tory and add to the CLASSPATH=0A- Put login.config into conf directory=0A- = Put users.properties and groups.properties into conf\org\apache\activemq\s= ecurity=0A- Use following code for initializing the embedded broker=0A=0A--= ----------------------------------------------------=0A=0A=0A// Server init= ialization=0ABrokerService broker =3D new BrokerService();=0Abroker.addConn= ector("tcp://localhost:61616");=0Abroker.setPlugins(new BrokerPlugin[] { ne= w JaasAuthenticationPlugin () }); =0A=0A=0Abroker.start();=0A-----------= -------------------------------------------=0A=0A=0ARegards,=0A=0AAli Sadik= Kumlali=0A=0A=0A[1] http://issues.apache.org/activemq/browse/AMQ-982=0A=0A= ----- Original Message ----=0AFrom: Adrian Co =0ATo: activem= q-users@geronimo.apache.org=0ASent: Thursday, December 14, 2006 9:34:19 AM= =0ASubject: Re: How can I enable principle and credentials for embedded bro= ker?=0A=0AOh! I'm sorry, I meant setPlugins. :)=0A=0AAli Sadik Kumlali wrot= e:=0A> Thank you Adrian. But I couldn't find addPlugins() method of BrokerS= ervice[1]. It seems I misunderstood you :)=0A>=0A>=0A> [1] http://svn.apach= e.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apach= e/activemq/broker/BrokerService.java?view=3Dmarkup=0A>=0A> ----- Original M= essage ----=0A> From: Adrian Co =0A> To: activemq-users@gero= nimo.apache.org=0A> Sent: Thursday, December 14, 2006 4:21:12 AM=0A> Subjec= t: Re: How can I enable principle and credentials for embedded broker?=0A>= =0A> I'd try using broker.addPlugins() and instantiate the different broker= =0A> plugins available.=0A>=0A> Ali Sadik Kumlali wrote:=0A> =0A>> Hi fo= lks,=0A>>=0A>> I've been walking through the documentation, mailing list an= d Google for a while but couldn't get a solution to my problem.=0A>>=0A>> I= need to;=0A>> 1) Use embedded broker=0A>> 2) Access initial context by pro= viding username(SECURITY_PRINCIPAL) and password(SECURITY__CREDENTIALS)=0A>= > 3) Create connections by providing username and password=0A>> =0A>> For = standalone case, I managed to do 3) by following the instructions[1]. But c= ouldn't find a way for 2) either.=0A>>=0A>> Here is the code snippet:=0A>>= =0A>> ----------------------------------------------=0A>> // Server initial= ization=0A>> BrokerService broker =3D new BrokerService();=0A>> broker.addC= onnector("tcp://localhost:61616");=0A>> broker.start();=0A>>=0A>>=0A>> // C= lient initialization=0A>> Properties props =3D new Properties();=0A>> props= .setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.Acti= veMQInitialContextFactory");=0A>> props.setProperty(Context.PROVIDER_URL,"t= cp://localhost:61616");=0A>> props.setProperty(Context.SECURITY_PRINCIPAL, = "contextUser");=0A>> props.setProperty(Context.SECURITY__CREDENTIALS, "cont= extPassword");=0A>>=0A>> Context jndiContext =3D new InitialContext(props);= =0A>> ...=0A>> Connection connection =3D connectionFactory.createConnection= ("connUser", "connPassword");=0A>> ----------------------------------------= ------=0A>>=0A>>=0A>> Now, how can I configure embedded broker to make it r= equire contextUser, contextPassword, connUser and connPassword?=0A>>=0A>> A= ny help would be appreciated.=0A>>=0A>> Regards,=0A>>=0A>> Ali Sadik Kumlal= i=0A>>=0A>>=0A>> [1] http://www.activemq.org/site/security.html=0A>>=0A>>= =0A>>=0A>>=0A>>=0A>>=0A>>=0A>> =0A>> _____________________________________= _______________________________________________=0A>> Any questions? Get ans= wers on any topic at www.Answers.yahoo.com. Try it now.=0A>>=0A>> =0A>> = =0A>=0A>=0A>=0A>=0A>=0A> ______________________________________________= ____=0A> Do You Yahoo!?=0A> Tired of spam? Yahoo! Mail has the best spam p= rotection around =0A> http://mail.yahoo.com =0A>=0A> =0A=0A=0A=0A=0A=0A__= ________________________________________________=0ADo You Yahoo!?=0ATired o= f spam? Yahoo! Mail has the best spam protection around =0Ahttp://mail.yah= oo.com