5 Replies Latest reply on Oct 18, 2006 1:24 AM by jaikiran pai

    Baffled using DatabaseServerLoginModule

    fenilya Newbie


      Im trying to use the JBoss DatabaseServerLoginModule. I entered the following configuration in the login-config.xml file:

      <application-policy name = "QuiverRealm">

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


      In my authenticationbean, I have the following code in the login method:

      public boolean login(String username, String password) throws LoginException {
      authenticated = false;
      char[] pwd = password.toCharArray();

      LoginContext loginContext = new LoginContext("QuiverRealm", new UsernamePasswordHandler(username, pwd));

      authenticated = true;

      return authenticated;

      Now, I made sure I tested with correct Username/Password combination a thousand times. Case sensitive and all that. Still, it tells me that my password is incorrect:

      13:39:54,572 ERROR [STDERR] javax.security.auth.login.LoginException: Password Incorrect/Password Required

      What am I missing here? Im baffled.