1 Reply Latest reply on Feb 21, 2002 2:15 AM by wurstfach

    ClientLoginModule  - no CallbackHandler available ...

    wurstfach

      I tried to use the ClientLoginModule for my standalone applicaion but something goes wrong.

      After I do a lc.login() the LoginModule throws an Exception because it can't find a CallbackHandler ( the CallbackHandler = null).

      To say in Detail:

      java.lang.System.setProperty("java.security.auth.login.config","etc/auth.conf");

      // let the LoginContext instantiate a new Subject
      LoginContext lc = null;
      try
      {
      lc = new LoginContext("example1");
      // authenticate the Subject
      lc.login();
      System.out.println("authentication successful");


      I'm not quite sure from where I should get that CallbackHandler? Should I call the initialize(...) method?

      I'm thankful for any advice.

        • 1. Re: ClientLoginModule  - no CallbackHandler available ...
          wurstfach

          I figured it out myself.

          I used the wrong Constructor for the Login Context. The right Constructor was:

          lc = new LoginContext("example1", new MyCallbackHandler());

          Where MyCallbackHandler is a Class that implements the Interface "CallbackHandler". I took the code for "MyCallbackHandler" from the jaas example from java. That worked fine :-)