如何配置ActiveMQ以将“匿名”用户和角色分配给未经身份验证的用户

时间:2021-10-28 05:04:27

I wish to set up a ActiveMQ instance (primarily as a STOMP server) which will service requests from two types of clients:

我希望设置一个ActiveMQ实例(主要作为STOMP服务器),它将为来自两种类型客户端的请求提供服务:

  1. authenticated users which can read and write to topics
  2. 经过身份验证的用户,可以读取和写入主题

  3. non-authenticated users which can only read from topics
  4. 未经身份验证的用户,只能从主题中读取

I have been using the SimpleAuthenticationBroker so far and I cannot see anyway to configure the above situation, nor do I see any bit in the code which recognises a wildcard for a user to pass authentication.

到目前为止我一直在使用SimpleAuthenticationBroker,无论如何我都看不到配置上述情况,也没有在代码中看到任何识别用户通过身份验证的通配符的位。

If I configure the server to use the authentication broker, it will expect ALL connections to authenticate, which is what I don't want.

如果我将服务器配置为使用身份验证代理,它将期望所有连接进行身份验证,这是我不想要的。

The only solution I think I can see is to provide my own implementation to support the functionality I require, but I would love to find some way built into the server.

我认为我能看到的唯一解决方案是提供我自己的实现来支持我需要的功能,但我希望找到一些内置于服务器中的方法。

3 个解决方案

#1


This is not currently supported by ActiveMQ security implementation, but you can always define a user that can connect without a password with read-only privileges.

ActiveMQ安全实现目前不支持此功能,但您始终可以定义一个可以在没有密码且具有只读权限的情况下进行连接的用户。

You can raise Jira enhancement request (https://issues.apache.org/activemq/browse/AMQ) for this non-authenticated users feature and better yet provide a patch for current plugins.

您可以为此未经过身份验证的用户功能提出Jira增强请求(https://issues.apache.org/activemq/browse/AMQ),并为当前插件提供更好的补丁。

#2


This feature is now available as of ActiveMQ 5.4, as I've just found when searching for the same functionality: http://activemq.apache.org/security.html

此功能现在从ActiveMQ 5.4开始提供,正如我在搜索相同功能时发现的那样:http://activemq.apache.org/security.html

#3


As of ActiveMQ 5.4, you can set it up in the following way. find the

从ActiveMQ 5.4开始,您可以通过以下方式进行设置。找出

<plugins>
    ...
</plugins>

section in the etc/activemq.xml file and edit it to contain the simpleAuthenticationPlugin like this:

在etc / activemq.xml文件中的部分并编辑它以包含simpleAuthenticationPlugin,如下所示:

<simpleAuthenticationPlugin anonymousAccessAllowed="true" />

Source: http://activemq.apache.org/security.html

#1


This is not currently supported by ActiveMQ security implementation, but you can always define a user that can connect without a password with read-only privileges.

ActiveMQ安全实现目前不支持此功能,但您始终可以定义一个可以在没有密码且具有只读权限的情况下进行连接的用户。

You can raise Jira enhancement request (https://issues.apache.org/activemq/browse/AMQ) for this non-authenticated users feature and better yet provide a patch for current plugins.

您可以为此未经过身份验证的用户功能提出Jira增强请求(https://issues.apache.org/activemq/browse/AMQ),并为当前插件提供更好的补丁。

#2


This feature is now available as of ActiveMQ 5.4, as I've just found when searching for the same functionality: http://activemq.apache.org/security.html

此功能现在从ActiveMQ 5.4开始提供,正如我在搜索相同功能时发现的那样:http://activemq.apache.org/security.html

#3


As of ActiveMQ 5.4, you can set it up in the following way. find the

从ActiveMQ 5.4开始,您可以通过以下方式进行设置。找出

<plugins>
    ...
</plugins>

section in the etc/activemq.xml file and edit it to contain the simpleAuthenticationPlugin like this:

在etc / activemq.xml文件中的部分并编辑它以包含simpleAuthenticationPlugin,如下所示:

<simpleAuthenticationPlugin anonymousAccessAllowed="true" />

Source: http://activemq.apache.org/security.html