In that case you're probably better off implementing your own security
manager [1]. ActiveMQ Artemis ships with three implementations [2] which
you can use as a reference:

 -
org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager
[3] (used by default by the standalone broker)
 -
org.apache.activemq.artemis.spi.core.security.ActiveMQBasicSecurityManager
[4]
 -
org.apache.activemq.artemis.spi.core.security.ActiveMQSecurityManagerImpl
[5]

If you're using
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ to embed
the broker you can set the security manager using the setSecurityManager
method [6].


Justin

[1]
https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManager5.java
[2]
https://activemq.apache.org/components/artemis/documentation/latest/security.html#user-credentials
[3]
https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQJAASSecurityManager.java
[4]
https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQBasicSecurityManager.java
[5]
https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/ActiveMQSecurityManagerImpl.java
[6]
https://github.com/apache/activemq-artemis/blob/main/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/embedded/EmbeddedActiveMQ.java#L72

On Mon, Mar 25, 2024 at 4:13 PM Mark Raynsford <org.apache.activ...@io7m.com>
wrote:

> On 25/03/2024 01:36, Justin Bertram wrote:
> > It's simple to use login.config with an embedded broker. You just need to
> > set the java.security.auth.login.config system property to the path of
> your
> > login.config file and it should work.
> >
>
> That's not great, to be honest. I'm essentially building what amounts to
> a reusable library that embeds a broker. Although I doubt many people
> would be creating multiple broker instances in the same application when
> using the library, it would mean that the library would have to set that
> system property (which might conflict with something the user has
> already set for their own application), and then create a file in the
> filesystem that otherwise wouldn't exist, and multiple brokers would
> likely step on each other's state.
>
> Is there no other way to pass in a list of login modules?
>
> --
> Mark Raynsford | https://www.io7m.com
>
>

Reply via email to