0 Replies Latest reply on May 27, 2006 10:00 PM by cpegwilliam

    DatabaseServerLoginModule

    cpegwilliam

      I am newbie of JBoss and Portal.
      Just installed JBoss 4.0.3 + Portal 2.2.1 + MySQL 4.1

      I am trying DatabaseServerLoginModule in login-config.xml.

       <application-policy name = "portal">
       <authentication>
       <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag = "required">
       <module-option name = "unauthenticatedIdentity">guest</module-option>
       <module-option name = "dsJndiName">java:/PortalDS</module-option>
       <module-option name = "principalsQuery">SELECT PASSWD FROM USERS WHERE USERNAME=?</module-option>
       <module-option name = "rolesQuery">SELECT USERROLES, 'Roles' FROM USERROLES WHERE USERNAME=?</module-option>
       </login-module>
       </authentication>
       </application-policy>
      


      Tables are created as follow:
      CREATE TABLE Users (
       userName VARCHAR(64) PRIMARY KEY,
       passwd VARCHAR(64)
      );
      
      INSERT INTO Users VALUES('admin', 'admin');
      
      CREATE TABLE UserRoles (
       userName VARCHAR(32) NOT NULL,
       userRoles VARCHAR(32) NOT NULL
      );
      
      INSERT INTO UserRoles VALUES('admin', 'admin');
      


      However, after i login, Error 403, unauthorized access come out. I guess it is the user, roles problems as the /auth/* need Authenticated roles to be defined.
      Then, i try to update the UserRoles of admin from "admin" to "Authenticated"

      INSERT INTO UserRoles VALUES('admin', 'Authenticated');
      


      it successfully log me in after updating the table. But this time, i have no way to get access to CMS and management pages anymore. Does anyone can help on this?
      Seems that Jboss portal need both "Authenticated" and "admin" roles to be defined in order to get my access the CMS and management pages?

      After explored with JBoss portal, i just quite confused on the ModelLoginModule and DatabaseServerLoginModule. I know ModelLoginModule is working together with UserModule and RoleModule. Does that mean DatabaseServerLoginModule or other loginmodule can't work with UserModule and RoleModule?

      Thanks!