2 Replies Latest reply on May 2, 2005 8:42 AM by markymarc

    SQL in Principals query will not work

    markymarc

      Im using the jbosssx serurity modul for my web login. And have teste it with some basic database and sql.
      But when I'm trying to move it to a prodution database and use a slidy more "advance" SQL it will not work.

      The basic sql(from login-config.xml):

      <module-option name = "principalsQuery">select password from users where username=?</module-option>


      The slidely more "advance":
      <module-option name = "principalsQuery">select pri.password from m_bruger bru, m_primed pri where pri.uid = bru.uid and bru.wdk=?</module-option>


      I know my sql is working and returning just the password. But still I get this error, when trying to looking in to me webmodul:
      11:26:26,433 INFO [STDOUT] javax.security.auth.login.FailedLoginException: No matching username found in Principals


      What im I missing or can't I use a query like the one I use in the principals query

        • 1. Re: SQL in Principals query will not work
          darranl

          Can you try enabling trace logging for the DatabaseServerLoginModule to prove that all of your values are set correctly.

          I have just had a look at the code, the only reason why you would get the error you are getting is if after the query is executed an empty result set is returned.

          Also you didn't say which database you are using, is there any way that you can enable tracing there to check what query is executed against the database.

          • 2. Re: SQL in Principals query will not work(SORRY)
            markymarc

            SORRY, VERY SORRY

            My own fault, I had forgotten to change the dsjndiname to the prodution db ups.

            Once done all worked fin.

            So once again sorry for wasting your time. But thank you for any reply.