5 Replies Latest reply on Oct 19, 2002 7:29 AM by rizwan

    Problem accessing secured EJB from inside a JSP

    abstractone

      Hello, Everyone,

      I experience problems when from inside a JSP I try to access secure EJB. I wrote a client
      class which does the authorization and calls the methods. It works perfectly
      when it is run as standalone app, but when I try to use it in the JSP the
      following exception is thrown:
      "javax.security.auth.login.LoginException: No LoginModules configured
      for other"

      Here is the code that I use to set up the login module and get the LoginContext:

      System.setProperty("java.security.auth.login.config", "/developer/jboss-test/jboss/client/auth.conf");
      AppCallbackHandler handler = new AppCallbackHandler(username, password.toCharArray());
      LoginContext lc = new LoginContext("other", handler);
      lc.login();

      Why it works as standalone app and doesnt when it is used in the JSP ?

      I am using JBoss 2.4.6 with Tomcat 4.0 on RedHat Linux 7.3 with JDK 1.4.0


      Thanx in advance.

      Emo