4 Replies Latest reply on Jun 18, 2003 2:54 AM by Sean Radford

    DatabaseServerLoginModule in 3.2.1

    Dmitry Mozheyko Novice

      I read previous topic and
      I wrote:

      ############################
      database.sql
      ############################
      ...
      create table jboss_users(
      code integer not null primary key,
      name varchar( 20),
      passwd varchar( 20),
      therole varchar( 20)
      );

      insert into jboss_users values ( 1, 'dm', 'dm', 'admin');
      insert into jboss_users values ( 2, 'qwerty', 'qwerty', 'user');
      ...
      ############################
      server/default/conf/login-config.xml
      ############################
      ...
      <application-policy name = "mozheyko">

      <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
      <module-option name="dsJndiName">java:/FirebirdDS</module-option>
      <module-option name="pricipalsQuery">select passwd from jboss_users where name=?</module-option>
      <module-option name="rolesQuery">select therole, 'Roles' from jboss_users where name=?</module-option>
      </login-module>

      </application-policy>
      ...
      ############################
      jboss-web.xml
      ############################
      ...
      <security-domain>java:/jaas/mozheyko</security-domain>
      ...

      ############################

      and turn DEBUG level in log4j.xml

      I RECEIVE:
      ...
      2003-06-17 16:16:53,278 DEBUG [org.jboss.jetty.security.JBossUserRealm#Main servlet] JBossUserPrincipal: dm
      2003-06-17 16:16:53,283 DEBUG [org.jboss.jetty.security.JBossUserRealm#Main servlet] created JBossUserRealm::JBossUserPrincipal: admin
      2003-06-17 16:16:53,284 DEBUG [org.jboss.jetty.security.JBossUserRealm#Main servlet] authenticating: Name:admin Password:****2003-06-17
      ...
      16:16:53,316 DEBUG [org.firebirdsql.jca.FBManagedConnection] preparing sql: select Password from Principals where
      PrincipalID=?

      ...
      What i forget and whence this quiry has undertaken ?