Hi DK-

Yes, you need to update the bin/activemq startup script to do two things:

1. List a classpath, instead of just one jar. It must include the 
bin/activemq.jar, lib/activemq-jaas.jar and lib/slf4j-api.jar.
2. Add the name of the ‘Main’ class to run on startup

For example, take a classpath 

Update the lines that us:

 -jar ${ACTIVEMQ_HOME}/bin/activemq.jar $COMMANDLINE_ARGS ...

To something like:

  -cp 
\"${ACTIVEMQ_HOME}/lib/activemq-jaas-5.18.1.jar:${ACTIVEMQ_HOME}/lib/slf4j-api-2.0.6.jar:${ACTIVEMQ_HOME}/bin/activemq.jar\"
 org.apache.activemq.console.Main $COMMANDLINE_ARGS --pid $SPID &

Thanks,
Matt Pavlovich

> On May 5, 2023, at 1:32 AM, Dnyaneshwar Kulkarni 
> <dnyaneshwar.kulkar...@gmail.com> wrote:
> 
> Hi Matt,
> 
> I have provided a login.config as 'activemq' but still java is not 
> considering this. Is this settings are specific to any perticular ActiveMQ 
> version?
> 
> We are currently using 5.16.1 with jdk 8.
> 
> Thank You.
> 
> Regards,
> DK
> 
> 
> On Wed, 3 May 2023, 20:44 Matt Pavlovich, <mattr...@gmail.com 
> <mailto:mattr...@gmail.com>> wrote:
>> Hello DK-
>> 
>> ActiveMQ uses the standard Java JDK parameters for enabling JMX.
>> 
>> The JMX flag for using the ‘activemq' JAAS login context name is:
>> 
>> -Dcom.sun.management.jmxremote.login.config=activemq 
>> 
>> Modifications to ActiveMQ’s startup is needed to add a classpath used by 
>> your custom JAAS module — adding them to the lib/ folder is not enough, you 
>> need to set the classpath with “-cp”.
>> 
>> I replied to your SO post as well.
>> 
>> Thanks,
>> Matt Pavlovich
>> 
>> 
>>> On May 3, 2023, at 12:30 AM, Dnyaneshwar Kulkarni 
>>> <dnyaneshwar.kulkar...@gmail.com <mailto:dnyaneshwar.kulkar...@gmail.com>> 
>>> wrote:
>>> 
>>> Hi Matt,
>>> 
>>> Thank you for your response. Currently I
>>>  have created own custom login module and updated login config with the 
>>> module. Provided that login config in jvm parameter also provided the 
>>> module name which I want to use. Also updated the activemq.xml file to 
>>> include jaasplugin. Still my custom login module is not getting called and 
>>> it is going with default FileLoginModule.
>>> 
>>> I have created below stack overflow question for your reference.
>>> 
>>> https://stackoverflow.com/questions/76111997/how-we-can-write-our-custom-jaas-login-implementation-read-the-encrypted-passwor?noredirect=1#comment134303903_76111997
>>> 
>>> Can you please help me to find out why it is not working? I something that 
>>> I'm doing wrong?
>>> 
>>> Thank you.
>>> 
>>> Regards,
>>> DK
>>> 
>>> 
>>> On Tue, 2 May 2023, 20:33 Matt Pavlovich, <mattr...@gmail.com 
>>> <mailto:mattr...@gmail.com>> wrote:
>>>> Hello DK-
>>>> 
>>>> Yes, reconfiguring JMX to use JAAS would be the approach to use encrypted 
>>>> passwords. 
>>>> 
>>>> I plan on converting the Apache distribution to use JAAS for JMX by 
>>>> default in an upcoming release. For now, you’ll need to convert it 
>>>> yourself.
>>>> 
>>>> Related JIRA:
>>>> https://issues.apache.org/jira/browse/AMQ-8391
>>>> 
>>>> Thanks,
>>>> Matt Pavlovich 
>>>> 
>>>> > On May 2, 2023, at 1:44 AM, Dnyaneshwar Kulkarni 
>>>> > <dnyaneshwar.kulkar...@gmail.com 
>>>> > <mailto:dnyaneshwar.kulkar...@gmail.com>> wrote:
>>>> > 
>>>> > Hi Team,
>>>> > 
>>>> > We have enabled the JMX support in our application for activemq. In
>>>> > actimmq.sql file we have added the Managmentcontext with create 
>>>> > connection
>>>> > as "true". We have provided the path for jmx.access file jmx password 
>>>> > file
>>>> > for the security. As these files are having plain text data we want to to
>>>> > use encrypted data.
>>>> > 
>>>> > To provide the custom login to support encryption i tried to add JAAS, 
>>>> > but
>>>> > seems like with MBean server it is not working.
>>>> > 
>>>> > Is there way by which I can achieve this?
>>>> > 
>>>> > Thanks in advance.
>>>> > 
>>>> > Regards,
>>>> > DK
>>>> 
>> 

Reply via email to