You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by an...@axa.com.au on 2004/02/18 06:59:19 UTC

Form Authentication is not working in Weblogic Portal 7.0 SP4,need help

I'm writing a test case, which is using form authentication. App Server is 

Weblogic Portal Server 7.0 SP4. 
I'm using ServletTestRunner to run the test case. 

But its not working, I tried everything, but didn't get any success. 
Here is the test case code: 

import junit.framework.*; 
import org.apache.cactus.*; 
import org.apache.cactus.client.authentication.BasicAuthentication; 
import org.apache.cactus.configuration.*; 

public class TestUserAccessManagement extends ServletTestCase{ 
 private UserAccessManagement userAccessManagement; 

 public TestUserAccessManagement(String name) { 
   super(name); 
 } 

 public static Test suite() { 
   return new TestSuite(TestUserAccessManagement.class); 
 } 

 public void begin(WebRequest theRequest){ 
// theRequest.addCookie("pc23165","set-cookie;JSESSIONID","1234_ankur"); 
//    theRequest.addHeader("set-cookie","JSESSIONID=1234_ankur;"); 
/*    theRequest.addCookie("pc23165","JSESSIONID","1234_ankur"); 
   theRequest.addHeader("Host", "PC23165"); 
   theRequest.addHeader("Connection", "Keep-Alive"); 
   theRequest.addHeader("Content-Type", 
"application/x-www-form-urlencoded"); 
//    theRequest.addHeader("Accept-Language", "en-au"); 
//    theRequest.addHeader("Cookie","JSESSIONID=1234_ankur");*/ 
   theRequest.setRedirectorName("ServletRedirectorSecure"); 
   FormAuthentication form = new 
FormAuthentication("visitor1","password"); 
   java.net.URL url = null; 
   try{ 
//      url = new java.net.URL("http://pc23165/eservice/application?namespace=security&event=button.login&origin=login.jsp&j_username=visitor1&j_password=password"); 
     url = new java.net.URL("http://pc23165/eservice/application?namespace=security&event=button.login&origin=login.jsp"); 
     System.out.println("URL:"+url); 
   }catch(java.net.MalformedURLException malException){ 
     System.out.println(malException); 
   } 
   theRequest.addHeader("set-cookie","JSESSIONID=1234_ankur;"); 
   theRequest.addCookie("pc23165","JSESSIONID","1234_ankur"); 
   theRequest.addCookie("pc23165","JSESSIONID","1234_ankur"); 
   theRequest.setRedirectorName("ServletRedirectorSecure"); 
 
form.getSecurityRequest().addHeader("set-cookie","JSESSIONID=1234_ankur;"); 

 form.getSecurityRequest().addCookie("pc23165","JSESSIONID","1234_ankur"); 

   form.getSecurityRequest().addParameter("Cactus_Service","GET_RESULTS"); 

   form.getSecurityRequest().setRedirectorName("ServletRedirectorSecure"); 

   form.getSecurityRequest().setAuthentication(form); 
   theRequest.addParameter("Cactus_Service","GET_RESULTS"); 
   form.setSecurityCheckURL(url); 
   theRequest.setAuthentication(form); 
 
 } 

 public void testIsUserLoggedIn() { 
   this.assertEquals("[User Is Not Logged 
In]",true,this.userAccessManagement.isUserLoggedIn()); 
 } 
} 

I enabled debugging for cactus and I will send debug information in my 
next mail.

*********************************************************************************
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
*********************************************************************************


RE: Form Authentication is not working in Weblogic Portal 7.0 SP4,need help

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Kazuhito,

Thanks very much. I'm applying your patch now. I'll let you know how it
goes.

Thanks
-Vincent

> -----Original Message-----
> From: Kazuhito SUGURI [mailto:suguri.kazuhito@lab.ntt.co.jp]
> Sent: 20 February 2004 03:56
> To: cactus-dev@jakarta.apache.org; ankur.kumar@axa.com.au
> Subject: Re: Form Authentication is not working in Weblogic Portal 7.0
> SP4,need help
> 
> Hi,
> 
> In article <OF5C4248D6.A4210881-ONCA256E3E.0020CE19-
> CA256E3E.0020EA8F@nm.com.au>,
> Wed, 18 Feb 2004 16:59:19 +1100,
> ankur.kumar@axa.com.au wrote:
> ankur.kumar> I'm writing a test case, which is using form
authentication.
> 
> This problem has been solved.
> I modified FormAuthentication while we (Ankur and I) were solving
this.
> # please refer archive of cactus-users ML for detail.
> 
> I believe the new FormAuthentication will be a solution for a issue:
> 	http://issues.apache.org/bugzilla/show_bug.cgi?id=17933
> 
> The code is appending to this message.
> The code is modified from the one of the source release of Cactus-1.5.
> 
> Best Regards,
> ----
> Kazuhito SUGURI
> mailto:suguri.kazuhito@lab.ntt.co.jp


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org


Re: Form Authentication is not working in Weblogic Portal 7.0 SP4,need help

Posted by Kazuhito SUGURI <su...@lab.ntt.co.jp>.
Hi,

In article <OF...@nm.com.au>,
Wed, 18 Feb 2004 16:59:19 +1100,
ankur.kumar@axa.com.au wrote: 
ankur.kumar> I'm writing a test case, which is using form authentication.

This problem has been solved. 
I modified FormAuthentication while we (Ankur and I) were solving this. 
# please refer archive of cactus-users ML for detail.

I believe the new FormAuthentication will be a solution for a issue:
	http://issues.apache.org/bugzilla/show_bug.cgi?id=17933

The code is appending to this message.
The code is modified from the one of the source release of Cactus-1.5.

Best Regards,
----
Kazuhito SUGURI
mailto:suguri.kazuhito@lab.ntt.co.jp