5 Replies Latest reply on Jul 18, 2002 3:54 PM by kiuma

    Using DatabaseServerLoginModule

    raffa

      I have done an authentication session using DatabaseServerLoginModule, but every time I try to do login with valid username/password the server log produces this message:
      ....
      15:41:47,962 ERROR [SecurityInterceptor] Insufficient method permissions, principal=raffa, method=create, requiredRoles=[Coder, Echo, trader], principalRoles=null
      ....

      But in my roles Table to the username->raffa corresponds the rolesName=trader!

      Why principalRoles is always null?

      Thanks in advance.

        • 1. Re: Using DatabaseServerLoginModule
          sweetfa

          In your login-config.xml what is your roles query.

          • 2. Re: Using DatabaseServerLoginModule
            raffa

            In my login-config.xml:
            ....

            <application-policy name = "testDB">

            <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
            flag = "required">
            <module-option name="dsJndiName">java:/OracleDS</module-option>
            <module-option name="principalsQuery">select passwd from Users where username=?</module-option>
            <module-option name="rolesQuery">select userRoles, userGroup from UserRoles where username=?</module-option>
            </login-module>

            </application-policy>

            ....

            I have take a look to DatabaseServerLoginModule source code, but it seems ok.

            Regards.

            • 3. Re: Using DatabaseServerLoginModule
              kiuma

              Please help me!

              My LoginSession continues to ask me users.properties file, but I'm tryng to use appointmentsApp app policy?

              Can you sen me you xml files.

              I really don't know how to do.

              Bye ,
              kiuma

              • 4. Re: Using DatabaseServerLoginModule
                raffa

                Kiuma, you have to configure your security-domain in jboss.xml



                <security-domain>java:/jaas/testDB</security-domain>
                ..........

                if you want that the security manager loads the DatabaseServerLoginModule

                Bye

                • 5. Re: Using DatabaseServerLoginModule
                  kiuma

                  Dear Raffaella I've seen that I forgot tag now I try again.

                  For you problem I don't know Oracle but I use PostgrSQL,

                  Postgresql wouldn't work because it distinguish between LowerCase and UpperCase in fields name.
                  I don't know the case of orcle but in my short experience I use all lowercases separated with underscores.

                  I also have to ask you a big pleasure I'm trying to build that damned application that make me login and a cmp level base. To help me and other people for basic problems.

                  If I don't get out could you correct my 'very small' app?
                  Bye,
                  Kiuma
                  I hope that what I said can help you anyway.