1 Reply Latest reply on May 14, 2007 8:51 PM by peterj

    jboss  login    DatabaseServletLoginModule  Jboss 4.0.5.GA

      I'm trying to use Mysql als login database but i run into sevral problems.

      1) my roles database is composed of 2 items,
      --MainFunction related(say default roles) and person relates(roles)
      my role file is a union of 2 queries connected with a variable.
      doing so I select 3 Coloms instead of 2 Coloms, (RoleID, RoleGroup, a bogus one)

      this seems to lock up the DatabaseServletLoginModule
      any idea's on how to solve this


      Query:
      <module-option name = "rolesQuery">
      SELECT allow as ROLEID, Role as RoleGroup ,@f:=at.Func FROM authorize ah,authenticate at
      WHERE at.user_name=ah.user_name
      AND (at.user_name=?) AND (at.Domain='domain')


      union select allow as ROLE, Role as RoleGroup , 'add' FROM authorize as ah1 WHERE ah1.user_name=@f </module-option>
      </login-module>



      Alternatively I had a look in using a stored procedure to add a kind of logging on roles access and doing the above in a stored procedures.


      the DatabaseServletLoginModule does not seem to like store procedures either.


      query:
      "rolesQuery"> call Roles(?)</module-option>

      Any idea's on how to solve this


      Thanks in advancce

        • 1. Re: jboss  login    DatabaseServletLoginModule  Jboss 4.0.5.
          peterj

          I have used the database login module, but never using it the way you are trying to. If I ran into your problems, I would look at security/src/main/org/jboss/security/auth/spi/DatabaseServerLoginModule.java in the source code, probably adding some logging code to figure out what is going wrong.

          Sorry that this doesn't answer your exact question, but hopefully this will give you somewhere to look to debug the problem.