5 Replies Latest reply on Jun 8, 2003 11:23 AM by budiyanto

    DatabaseServerLoginModule Newbie

    budiyanto Newbie

      Hi !
      i want to make client application that call an ejb that will authenticate the client. So a client lookup for loginEJB and call the ejblogin method. The method it self actualy creating logincontext and execute the login. I want to use DatabaseServerLoginModule and mysql.

      When deploying and running the client app, i always receive error like this
      14:39:17,546 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files

      java.io.IOException: Properties file users.properties not found

      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadProperties(UsersRolesLoginModule.java:212)
      .......

      Can anyone help me? I really don't have any idea how to fix this.

      i already set login-config.xml, server auth.conf and app.policy and i also made users.properties but the error still the same

        • 1. Re: DatabaseServerLoginModule Newbie
          Vincent B Fischer Newbie

          Its tough to debug without seeing your associated configurations...

          Make sure you have the following:
          1. In login-confi.xml, make sure you have something like this:
          <application-policy name="budget">

          <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
          <module-option name="dsJndiName">java:/DaytonaDS</module-option>
          <module-option name="principalsQuery">select PASSWORD from SYS_USER where USERNAME=?</module-option>
          <module-option name="rolesQuery">select userRoles, 'Roles' from USER_ROLES where username=?</module-option>
          </login-module>

          </application-policy>

          2. In your deployed app, you should have <security-domain>java:/jaas/budget</security-domain>
          in your jboss.xml

          3. In your ejb-jar.xml file, make sure you setup your security-role-ref and method permissions in your assembly-descriptor.

          4. Make sure your you specify your login config on the command line when running, and that it looks like this:
          login.conf:
          other {
          org.jboss.security.ClientLoginModule required
          ;
          };

          Hope this helps. If it doesn't, attach your referenced files so we can see the details.

          • 2. Re: DatabaseServerLoginModule Newbie
            budiyanto Newbie

            first of all thank you for replying my message. I already follow your instruction but i still got the problem.

            I developed usng jbuilder8 and jboss3.20. I attach the sample program i made in the zip file (32kb) maybe there's some configuration i miss. Where i must put the configuration file.... I also capture the error in txt format.

            Thanks Alot for the help

            • 3. Re: DatabaseServerLoginModule Newbie
              Vincent B Fischer Newbie

              No problem. I've gotten lots of help around here, so I try to chip in when I can.

              1. auth.conf. This is not correct. It should look like this:
              other {
              org.jboss.security.ClientLoginModule required
              ;
              };

              It looks like you've got stuff in your policy file in there.

              2. I see you included a login-conf.xml. This should actually be login-config.xml, and be located in the conf directory of your server (/server/default/conf). Other than that, it looks ok.

              3. You didn't include your jboss.xml file. Make sure that you specify the policy in #2 above in there.

              Good luck

              • 4. Re: DatabaseServerLoginModule Newbie
                budiyanto Newbie

                i still don't get it right. no error but i dont see any authentification happens also i try incorect user name and password but they both execute the protected method. I also want to ask how to use userpasswordHandler from jboss ? Thanks alot for the help.

                ps : i also attach the small test program i made and all the jboss console view and the client view. I hope it help.

                • 5. Re: DatabaseServerLoginModule Newbie
                  budiyanto Newbie

                  ok after trying and trying i finally got it. can i use the procedure for ejb that called the login context? Until now i just try from the client side?

                  THanks Alot For The Help