2 Replies Latest reply on Mar 29, 2002 10:55 AM by Wellie Chao

    Tomcat - JBoss - DatabaseServerLoginModule

    John Fleenor Newbie

      To config a tomcat to jboss database :

      In the jboss/conf/catalina/auth.conf add the following :
      database {
      /* A JDBC based LoginModule
      LoginModule options:
      dsJndiName: The name of the DataSource of the database containing the Principals, Roles tables
      principalsQuery: The prepared statement query equivalent to:
      "select Password from Principals where PrincipalID=?"
      rolesQuery: The prepared statement query equivalent to:
      "select Role, RoleGroup from Roles where PrincipalID=?"
      */
      org.jboss.security.auth.spi.DatabaseServerLoginModule required
      dsJndiName="java:/DefaultDS"
      principalsQuery="select Password from Principals where PrincipalID=?"
      rolesQuery="select Role, RoleGroup from Roles where PrincipalID=?"
      ;
      };

      In the web.xml file deployed with your app add :
      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>database</realm-name>
      </login-config>

      In the jboss-web.xml add :

      <security-domain>java:/jaas/database</security-domain>

      In the jboss.xml add :

      <security-domain>java:jaas/database</security-domain>