2 Replies Latest reply on Jun 5, 2005 12:59 PM by starksm64

    Is Using DatabaseServerLoginModule w/o rolesQuery Okay ?

    kenlohwh

      I'm starting to use JBossSX for my webapp.
      I'm using DatabaseServerLoginModule for user authentication.

      However, at login, I'm getting javax.security.auth.login.FailedLoginException: No matching username found in Principals.

      Therefore, I'd like to ask if it is okay if I use only principalsQuery without rolesQuery ? This is because my database does not have columns for roles and rolesgroup. I don't know if the absence of rolesQuery causes the exception.

      Any help would be very much appreciated.

        • 1. Re: Is Using DatabaseServerLoginModule w/o rolesQuery Okay ?

           

          "kenlohwh" wrote:

          Therefore, I'd like to ask if it is okay if I use only principalsQuery without rolesQuery ?


          I don't know you have to set an role query. I "solved" this problem by using the following roles query:
          SELECT varchar 'MyStaticRole' AS "roles";

          It always does return the MyStaticRole as return...

          Jan

          • 2. Re: Is Using DatabaseServerLoginModule w/o rolesQuery Okay ?
            starksm64

            The roles query behavior will be made optional in the future. If your not using declarative roles, the roles query should be something like:

            select 'InvalidRole', 'Roles' from MY_USERS where userid=?
            


            which will place the unassigned InvalidRole into the usual Subject group called 'Roles'. If you want to assign every user a guest role or similar, use that. If you don't want any declarative roles, either change 'Roles' to a name like 'NoRoles' or specify a userid that has no match.