11 Replies Latest reply on Apr 1, 2003 1:43 PM by Mick Knutson

    DatabaseServerLoginModule

    Dmitry Mozheyko Novice

      Hello all !

      I use jboss 3.0.6
      and FirebrdSQL 1.0.908 configured as DefaultDS

      I make all under the documentation
      1. Database

      create table users(
      username varchar(64) not null primary key,
      passwd varchar(64)
      ) ;

      create table userroles(
      username varchar(64),
      userroles varchar(32)
      );

      insert into users values( 'dimka', 'thepassword');
      insert into users values( 'vovka', 'drowssapeht');
      insert into users values( 'serega', 'elephant');

      insert into userroles values( 'dimka', 'admin');
      insert into userroles values( 'vovka', 'user');
      insert into userroles values( 'serega', 'viewer');

      2. /server/default/conf/login-config.xml

      <application-policy name = "FirebirdDBRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">sysdba</module-option>
      <module-option name = "userName">sysdba</module-option>
      <module-option name = "password">masterkey</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=FirebirdDS</module-option>
      <module-option name = "principalsQuery">SELECT PASSWD FROM USERS WHERE USERNAME=?</module-option>
      <module-option name = "rolesQuery">SELECT USERROLES FROM USERROLES WHERE USERNAME=?</module-option>
      </login-module>

      </application-policy>

      3. jboss-web.xml of my WAR:
      ...
      <security-domain>java:/jaas/FirebirdDBRealm</security-domain>
      ...

      If i try to connect i see messages:

      14:19:02,441 DEBUG [JBossUserRealm#InternetSalon Administration] JBossUserPrincipal: dimka
      14:19:02,447 DEBUG [JBossUserRealm#InternetSalon Administration] created JBossUserRealm::JBossUserPrincipal: dimka
      14:19:02,448 DEBUG [JBossUserRealm#InternetSalon Administration] authenticating: Name:dm Password:****
      14:19:02,450 DEBUG [JBossUserRealm#InternetSalon Administration] authenticated: dimka
      14:19:02,452 DEBUG [JBossUserRealm#InternetSalon Administration] setting JAAS subjectAttributeName(j_subject) : Subject:
      Principal: sysdba
      Private Credential: javax.resource.spi.security.PasswordCredential@38000000

      14:19:02,453 DEBUG [JBossUserRealm#InternetSalon Administration] JBossUserPrincipal: dimka is NOT in Role: admin
      14:19:02,454 DEBUG [JBossUserRealm#InternetSalon Administration] JBossUserPrincipal: dimka is NOT in Role: user
      14:19:02,454 DEBUG [JBossUserRealm#InternetSalon Administration] JBossUserPrincipal: dimka is NOT in Role: viewer
      14:19:02,457 WARN [jbossweb] WARNING: AUTH FAILURE: role for dimka

      What I have overlooked or have made not so?

      Thanks
      Mozheyko D.