<!-- NOTE: this is a just subset of conf/login-config.xml.
     This entry can be used to replace the existing jmx-console application-policy elements.
 	 to provide for a database-based security domain -->
	 
<!-- This stores user information in the database.  There are two users in the DB
      Username: SomeUser, password:  password
	  Username: admin, password: admin
 -->

    <application-policy name = "jmx-console">
       <authentication>
          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
             flag = "required">
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "dsJndiName">java:/CatalogDS</module-option>
             <module-option name = "principalsQuery">SELECT PASSWORD FROM JMX_CONSOLE_USERS WHERE USERID=?</module-option>
             <module-option name = "rolesQuery">SELECT ROLE, 'Roles' FROM JMX_CONSOLE_ROLES WHERE USERID=?</module-option>
          </login-module>
       </authentication>
    </application-policy>