diff --git a/docs/user-manual/en/security.md b/docs/user-manual/en/security.md
index efc610a483..9e49adf6e3 100644
--- a/docs/user-manual/en/security.md
+++ b/docs/user-manual/en/security.md
@@ -54,7 +54,7 @@ specified. If the user has any of those roles, he/she will be granted
that permission for that set of addresses.
Let's take a simple example, here's a security block from
-`activemq-configuration.xml` or `activemq-queues.xml` file:
+`activemq-configuration.xml` file:
@@ -67,7 +67,7 @@ Let's take a simple example, here's a security block from
The '`#`' character signifies "any sequence of words". Words are
delimited by the '`.`' character. For a full description of the wildcard
-syntax please see [Understanding the HornetQ Wildcard Syntax](wildcard-syntax.md).
+syntax please see [Understanding the HornetQ Wildcard Syntax](wildcard-syntax.md).
The above security block applies to any address
that starts with the string "globalqueues.europe.":
@@ -132,159 +132,45 @@ For more information on configuring the SSL transport, please see [Configuring t
## Basic user credentials
ActiveMQ ships with a security manager implementation that reads user
-credentials, i.e. user names, passwords and role information from an xml
-file on the classpath called `activemq-users.xml`. This is the default
-security manager.
+credentials, i.e. user names, passwords and role information from properties
+files on the classpath called `activemq-users.properties` and `activemq-roles.properties`. This is the default security manager.
If you wish to use this security manager, then users, passwords and
-roles can easily be added into this file.
+roles can easily be added into these files.
-Let's take a look at an example file:
+To configure this manager then it needs to be added to the `bootstrap.xml` configuration.
+Lets take a look at what this might look like:
-
+
+ file:${activemq.home}/config/non-clustered/activemq-users.properties
+ file:${activemq.home}/config/non-clustered/activemq-roles.properties
+ guest
+
-
-
-
+The first 2 elements `users` and `roles` define what properties files should be used to load in the users and passwords.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-The first thing to note is the element `defaultuser`. This defines what
+The next thing to note is the element `defaultuser`. This defines what
user will be assumed when the client does not specify a
username/password when creating a session. In this case they will be the
-user `guest` and have the role also called `guest`. Multiple roles can
-be specified for a default user.
+user `guest`. Multiple roles can be specified for a default user in the
+`activemq-roles.properties`.
-We then have three more users, the user `tim` has the role `admin`. The
-user `andy` has the roles `admin` and `guest`, and the user `jeff` has
-the roles `europe-users` and `guest`.
+Lets now take alook at the `activemq-users.properties` file, this is basically
+just a set of key value pairs that define the users and their password, like so:
-## Changing the security manager
+ bill=activemq
+ andrew=activemq1
+ frank=activemq2
+ sam=activemq3
-If you do not want to use the default security manager then you can
-specify a different one by editing the file `activemq-beans.xml` (or
-`activemq-jboss-beans.xml` if you're running JBoss Application Server)
-and changing the class for the `ActiveMQSecurityManager` bean.
+The `activemq-roles.properties` defines what groups these users belong too
+where the key is the user and the value is a comma seperated list of the groups
+the user belongs to, like so:
-Let's take a look at a snippet from the default beans file:
-
-
-
-
-
-
-
-The class
-`org.apache.activemq.spi.core.security.ActiveMQSecurityManagerImpl` is
-the default security manager that is used by the standalone server.
-
-ActiveMQ ships with two other security manager implementations you can
-use off-the-shelf; one a JAAS security manager and another for
-integrating with JBoss Application Sever security, alternatively you
-could write your own implementation by implementing the
-`org.apache.activemq.spi.core.security.ActiveMQSecurityManager`
-interface, and specifying the classname of your implementation in the
-file `activemq-beans.xml` (or `activemq-jboss-beans.xml` if you're
-running JBoss Application Server).
-
-These two implementations are discussed in the next two sections.
-
-## JAAS Security Manager
-
-JAAS stands for 'Java Authentication and Authorization Service' and is a
-standard part of the Java platform. It provides a common API for
-security authentication and authorization, allowing you to plugin your
-pre-built implementations.
-
-To configure the JAAS security manager to work with your pre-built JAAS
-infrastructure you need to specify the security manager as a
-`JAASSecurityManager` in the beans file. Here's an example:
-
-
-
-
-
- org.apache.activemq.jms.example.ExampleLoginModule
-
-
-
-
-
-
-
-
-Note that you need to feed the JAAS security manager with three
-properties:
-
-- ConfigurationName: the name of the `LoginModule` implementation that
- JAAS must use
-
-- Configuration: the `Configuration` implementation used by JAAS
-
-- CallbackHandler: the `CallbackHandler` implementation to use if user
- interaction are required
-
-## Example
-
-See ? for an example which shows how ActiveMQ can be configured to use
-JAAS.
-
-## JBoss AS Security Manager
-
-The JBoss AS security manager is used when running ActiveMQ inside the
-JBoss Application server. This allows tight integration with the JBoss
-Application Server's security model.
-
-The class name of this security manager is
-`org.apache.activemq.integration.jboss.security.JBossASSecurityManager`
-
-Take a look at one of the default `activemq-jboss-beans.xml` files for
-JBoss Application Server that are bundled in the distribution for an
-example of how this is configured.
-
-### Configuring Client Login
-
-JBoss can be configured to allow client login, basically this is when a
-JEE component such as a Servlet or EJB sets security credentials on the
-current security context and these are used throughout the call. If you
-would like these credentials to be used by ActiveMQ when sending or
-consuming messages then set `allowClientLogin` to true. This will bypass
-ActiveMQ authentication and propagate the provided Security Context. If
-you would like ActiveMQ to authenticate using the propagated security
-then set the `authoriseOnClientLogin` to true also.
-
-There is more info on using the JBoss client login module
-[here](http://community.jboss.org/wiki/ClientLoginModule)
-
-> **Note**
->
-> If messages are sent non blocking then there is a chance that these
-> could arrive on the server after the calling thread has completed
-> meaning that the security context has been cleared. If this is the
-> case then messages will need to be sent blocking
-
-### Changing the Security Domain
-
-The name of the security domain used by the JBoss AS security manager
-defaults to `java:/jaas/activemq
- `. This can be changed by specifying `securityDomainName`
-(e.g. java:/jaas/myDomain).
+ bill=user
+ andrew=europe-user,user
+ frank=us-user,news-user,user
+ sam=news-user,user
## Changing the username/password for clustering
diff --git a/examples/jms/jaas/pom.xml b/examples/jms/jaas/pom.xml
deleted file mode 100644
index e86300c037..0000000000
--- a/examples/jms/jaas/pom.xml
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
- 4.0.0
-
-
- org.apache.activemq.examples.jms
- jms-examples
- 6.0.0-SNAPSHOT
-
-
- activemq-jms-jaas-example
- jar
- ActiveMQ6 JMS "JAAS" Example
-
-
-
- org.apache.activemq.examples.jms
- activemq-jms-examples-common
- ${project.version}
-
-
- org.apache.activemq
- activemq-core-client
- ${project.version}
-
-
- org.apache.activemq
- activemq-server
- ${project.version}
-
-
- org.apache.geronimo.specs
- geronimo-jms_2.0_spec
-
-
-
-
-
-
- org.apache.activemq
- activemq-maven-plugin
-
-
- start
-
- start
-
-
-
- org.apache.activemq.jms.example.ExampleLoginModule
-
-
- org.apache.activemq.jms.example.ExampleLoginModule
-
- jboss
- redhat
- guest
-
-
-
-
-
- build.directory
- ${basedir}/target/
-
-
-
-
-
- runClient
-
- runClient
-
-
- org.apache.activemq.jms.example.JAASExample
-
- tcp://localhost:5445
-
-
-
-
- stop
-
- stop
-
-
-
-
-
- org.apache.activemq.examples.jms
- activemq-jms-jaas-example
- ${project.version}
-
-
- org.apache.activemq
- activemq-core-client
- ${project.version}
-
-
- org.apache.activemq
- activemq-server
- ${project.version}
-
-
- org.apache.activemq
- activemq-jms-client
- ${project.version}
-
-
- org.apache.activemq
- activemq-jms-server
- ${project.version}
-
-
- io.netty
- netty-all
- ${netty.version}
-
-
- org.apache.geronimo.specs
- geronimo-jms_2.0_spec
- ${geronimo.jms.2.spec.version}
-
-
-
- false
- ${basedir}/target/classes/activemq/server0
-
-
-
-
-
-
diff --git a/examples/jms/jaas/readme.html b/examples/jms/jaas/readme.html
deleted file mode 100644
index 4c7d0d3a9e..0000000000
--- a/examples/jms/jaas/readme.html
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
- ActiveMQ JAAS Example
-
-
-
-
-
-
JAAS Example
-
-
This example shows you how to configure ActiveMQ to use JAAS for security.
-
ActiveMQ can leverage JAAS to delegate user authentication and authorization to existing security infrastructure.
-
-
- The example will show how to configure ActiveMQ with JAAS in activemq-beans.xml
- (You would use activemq-jboss-beans.xml if you are running inside JBoss Application
- Server).
- It will use a simple LoginModule without any user interaction.
- The example will create a connection and authenticate the user with this JAAS LoginModule, send a message
- to a queue and receive it (see the Queue example for a complete description
- of the application code)
-
-
Note than the example actually sets the security manager via the maven pom.xml, however for we will discuss as if
- the activemq-beans.xml is being configured, the example beans file can be found under the src/main/resources
- directory
-
Example setup
-
ActiveMQ can use a JAAS security manager by specifying it in activemq-beans.xml:
-
- <!-- The security manager using JAAS -->
- <bean name="ActiveMQSecurityManager" class="org.apache.activemq.integration.jboss.security.JAASSecurityManager">
- <property name="configurationName">org.apache.activemq.jms.example.ExampleLoginModule</property>
- <property name="configuration">
- <inject bean="ExampleConfiguration"/>
- </property>
- <property name="callbackHandler">
- <inject bean="ExampleCallbackHandler" />
- </property>
- </bean>
-
- <!-- JAAS uses a simple LoginModule where the user credentials and roles are
- specified as options in the constructor -->
- <bean name="ExampleConfiguration" class="org.apache.activemq.jms.example.ExampleConfiguration">
- <constructor>
- <parameter>org.apache.activemq.jms.example.ExampleLoginModule</parameter>
- <parameter>
- <map class="java.util.HashMap" keyClass="java.lang.String"
- valueClass="java.lang.String">
- <entry>
- <key>user</key>
- <value>jboss</value>
- </entry>
- <entry>
- <key>pass</key>
- <value>redhat</value>
- </entry>
- <entry>
- <key>role</key>
- <value>guest</value>
- </entry>
- </map>
- </parameter>
- </constructor>
- </bean>
-
- <!-- the CallbackHandler does nothing as we don't have any user interaction -->
- <bean name="ExampleCallbackHandler" class="org.apache.activemq.jms.example.ExampleCallbackHandler"
- />
-
-
-
-
the ActiveMQSecurityManager's configurationName must be the name of the Java class implementing LoginModule
-
the callbackHandler property must be an implementation of CallbackHandler. In this example, the ExampleCallbackHandler
- does nothing since the authentication requires no user interaction
-
the configuration property must be an implementation of Configuration. For simplicity, we pass directly the
- user credentials as options to the ExampleConfiguration constructor. These options will be passed to an instance
- of ExampleLoginModule which will check that the only valid user is "jboss" with the password "redhat"
- and it has the role "guest".
-
-
-
Example step-by-step
-
To run the example, simply type mvn verify from this directory
-
The only relevant step with regard to JAAS configuration is step 4 (all the other
- steps are identical to the Queue example).
-
-
We create a JMS Connection with user "jboss" and password "redhat". Any other
- combination of name and password won't be valid for the ExampleLoginModule