1 Reply Latest reply on Dec 28, 2001 11:39 AM by Tom Gullo

    Putting it all together

    Tom Gullo Newbie

      Security is pretty important and I can't wait to get it to work. My problem is I keep getting the error message:
      "Unable to locate a login configuration".
      I know this issue has been discussed a bit, but if anyone could post an example showing all the files that need to be set up, I would greatly appreciate it.

      I am attempting to run the example written by Scott Stark in his helpful article at javaworld:
      http://www.javaworld.com/javaworld/jw-08-2001/jw-0831-jaas_p.html

      If interested, here are what my files look like:

      server auth.conf
      example1 {
      org.jboss.security.auth.spi.UsersRolesLoginModule required
      unauthenticatedIdentity=nobody
      ;
      };

      client auth.conf
      example1 {
      org.jboss.security.ClientLoginModule required;
      };

      users.properties in the jar file
      # The username to password mapping properties file
      java=echoman
      duke=javaman

      roles.properties in the jar file
      # The username to role(s) mapping properties file
      java=Echo
      duke=Java,Coder
      java.CallerPrincipal=caller_java
      duke.CallerPrincipal=caller_duke

      and the client attempt to get a LoginContext (that fails):

      AppCallbackHandler handler = new AppCallbackHandler("java", "echoman");
      LoginContext lc = new LoginContext("example1", handler);

      Any help would be greatly appreciated.



        • 1. Re: Putting it all together
          Tom Gullo Newbie

          On M$ Windows, I placed the client auth.conf in a directory, Jboss will find it if you specify the following line of code:

          System.setProperty("java.security.auth.login.config", "file:/C:/auth.conf");

          By doing this, I got Scott Stark's example SessionClient working.