0 Replies Latest reply on Aug 23, 2002 3:39 AM by Sergei Batiuk

    Tomcat 4.0.3 and JAAS

    Sergei Batiuk Newbie

      Hello,

      My system is:
      JBoss-3.0.0_Tomcat4.0.3 (integrated)
      JDK 1.4
      Windows 2000

      I have been trying to login into the integrated container using JAAS. My code looks as follows:


      >>
      Set principals = new HashSet();
      Set privateCredentials = new HashSet();
      Set publicCredentials = new HashSet();

      principals.add( "user" );
      publicCredentials.add( "publicCred" );
      privateCredentials.add( "privateCred" );

      Subject subject = new Subject( false, principals, publicCredentials, privateCredentials );

      LoginContext lc = new LoginContext( "JaasTest", subject );

      lc.login();
      <<

      It works fine for JBoss. However, when in a JSP invoke request.getRemoteUser(), I get null, instead of expected "user". What's wrong?