You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Kazuhito SUGURI <su...@lab.ntt.co.jp> on 2004/02/19 12:15:36 UTC

Re: CACTUS + JBOSS + JAAS

Hi Horatiu,

In article <40...@memiq.ro>,
Mon, 26 Jan 2004 18:01:12 +0200,
Horatiu Parfene <ho...@memiq.ro> wrote: 
horatiu.parfene> I want to test my EJBs but I am unable to autehnticate against jboss my 
horatiu.parfene> Cactus Test Classes. The login of the application uses j_security_check.

I have done it recentry.
# You may already solved this :-)

What I did is as follows:
1. configure Servlet Container and EJB Container
   to use the same security-domain.
2. define ServletRedirectSecure and its security in web.xml.
3. add authentication related statements in beginXXX() methods:
       public void beginXXX(WebRequest request){
           request.setRedirectorName("ServletRedirectorSecure");
           FormAuthentication auth = new FormAuthentication("usernam", "password");
           request.setAuthentication(auth);
       }
4. run test (as usual)

See also http://jakarta.apache.org/cactus/writing/howto_security.html 


In my testcase, Context is set in setUp() method like:
      private Context context;
      ...
      public void setUp(){
          super.setUp();
	  context = new InitialContext();
      }


As show above, I don't pass a Properties object
in the InitialContext constructor, however,
this works fine for me with JBoss-3.2.3.


For your informatin,
----
Kazuhito SUGURI
mailto:suguri.kazuhito@lab.ntt.co.jp