2 Replies Latest reply on May 19, 2006 6:00 AM by Yogendra Rampuria

    DatabaseServerLoginModule help

    William Newbie

      Hi all, I'm having a hard time getting any responses w/ the JBossSX/JAAS stuff (maybe cause I'm so lost no one wastes the time) so I'm going to drop it in here if that's ok.

      I'm just trying to allows my users w/ assigned roles using username/password to login using the databaseServerLoginModule, but having a hard time understanding what to do w/ so little documentation.

      Here's what I've done so far and if someone could point me in the right direction w/ more steps, much appreciated.

      I've created tables in my postgresql database as such ...

      CREATE SEQUENCE principals_seq;
      CREATE TABLE Principals(
       principalId INT PRIMARY KEY,
       principalName VARCHAR(64)
       password VARCHAR(32)
      );
      
      CREATE SEQUENCE roles_seq;
      CREATE TABLE Roles(
       roleId INT PRIMARY KEY,
       roleName VARCHAR(32),
       roleGroup VARCHAR(32)
      );
      


      And I have a ~/WEB-INF/login-config.xml file like this ...

      <application-policy name="myAppName">
       <authentication>
       <login-module
       code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag="required">
       <module-option name="unauthenticatedIdentity">
       guest
       </module-option>
       <module-option name="dsJndiName">
       java:/PostgresDS
       </module-option>
       <module-option name="principalsQuery">
       SELECT password FROM Principals WHERE principalId=?
       </module-option>
       <module-option name="rolesQuery">
       SELECT roleId,'Roles' FROM Roles WHERE principalId=?
       </module-option>
       </login-module>
       </authentication>
      </application-policy>
      


      Now the rest of what I'm to do is where I'm lost. I'm trying to figure out the proper way of getting the fields of my web page into the servlet that I think is supposed to use callbacks and then ... the JAAS stuff from there.

      Any more details here? Any help much appreciated.