jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ankur.ku...@axa.com.au
Subject Re: Form Authentication is not working in Weblogic Portal 7.0 SP4,need help
Date Thu, 19 Feb 2004 01:47:14 GMT
Hi Kazuhito,

Now, I'm using standard auth mechanism, here is the begin method:

 public void begin(WebRequest theRequest){
         theRequest.setRedirectorName("ServletRedirectorSecure");
         FormAuthentication form = new 
FormAuthentication("visitor1","password");
         theRequest.setAuthentication(form);
}

But still getting exceptions, I commented out this code in 
FormAuthentication#authenticate:
/*  if (connection.getResponseCode() != 302)
            {
                throw new ChainedRuntimeException("Unable to login, "
                    + "probably due to bad username/password. Received a 
["
                    + connection.getResponseCode() + "] response code and 
"
                    + "was expecting a [302]");
            }*/

Here is the debug/stacktrace info:

ectorSecure]
2004/02/19 12:45:29:122 EST [DEBUG] ConnectionHelperFactory - 
-<getConnectionHelper([http://pc23165:80/eservice/ServletR
edirectorSecure], 
[org.apache.cactus.configuration.ServletConfiguration@40c608])
2004/02/19 12:45:29:122 EST [DEBUG] ConnectionHelperFactory - 
->getConnectionHelper = [org.apache.cactus.client.connecto
r.http.HttpClientConnectionHelper@47b25b]
2004/02/19 12:45:29:122 EST [DEBUG] HttpClientConnectionHelper - 
-<connect([simulation URL = [null], automatic session =
 [true], cookies = [], headers = [], GET parameters = [], POST parameters 
= []], [org.apache.cactus.configuration.Servle
tConfiguration@40c608])
2004/02/19 12:45:29:122 EST [DEBUG] HttpUtil - 
-<addHttpGetParameters([simulation URL = [null], automatic session = [tru
e], cookies = [], headers = [], GET parameters = [], POST parameters = 
[]], [http://pc23165:80/eservice/ServletRedirecto
rSecure])
2004/02/19 12:45:29:122 EST [DEBUG] HttpUtil - ->addHttpGetParameters = 
[http://pc23165:80/eservice/ServletRedirectorSec
ure]
2004/02/19 12:45:29:231 EST [DEBUG] UrlUtil - 
-<getPath([http://pc23165:80/eservice/ServletRedirectorSecure])
2004/02/19 12:45:29:231 EST [DEBUG] UrlUtil - ->getPath = 
[/eservice/ServletRedirectorSecure]
2004/02/19 12:45:29:231 EST [DEBUG] UrlUtil - 
-<getQuery([http://pc23165:80/eservice/ServletRedirectorSecure])
2004/02/19 12:45:29:231 EST [DEBUG] UrlUtil - ->getQuery = []
2004/02/19 12:45:29:247 EST [DEBUG] CookieUtil - 
-<createHttpState([simulation URL = [null], automatic session = [true],
 cookies = [], headers = [], GET parameters = [], POST parameters = []], 
[http://pc23165:80/eservice/ServletRedirectorSe
cure])
2004/02/19 12:45:29:278 EST [DEBUG] CookieUtil - 
-<createHttpClientCookies([simulation URL = [null], automatic session =
 [true], cookies = [], headers = [], GET parameters = [], POST parameters 
= []], [http://pc23165:80/eservice/ServletRedi
rectorSecure])
2004/02/19 12:45:29:278 EST [DEBUG] CookieUtil - ->createHttpClientCookies 
= [[Lorg.apache.commons.httpclient.Cookie;@e7
cb6]
2004/02/19 12:45:29:278 EST [DEBUG] ChainedRuntimeException - 
-<printStackTrace([java.io.PrintWriter@1dbb53])
2004/02/19 12:45:29:278 EST [DEBUG] ChainedRuntimeException - 
->printStackTrace
2004/02/19 12:45:29:278 EST [DEBUG] WebClientTestCaseDelegate - -Exception 
in test <org.apache.cactus.util.ChainedRuntim
eException: Failed to authenticate the 
principal>org.apache.cactus.util.ChainedRuntimeException: Failed to 
authenticate
the principal
        at 
com.axa.eplatform.FormAuthentication.authenticate(FormAuthentication.java:315)
        at 
com.axa.eplatform.FormAuthentication.configure(FormAuthentication.java:156)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:126)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:201)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:119)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:22
2)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281
)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300)
        at 
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:313)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:151)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
        at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
        at 
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
        at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
java.lang.NoSuchMethodError
        at 
org.apache.commons.httpclient.HttpState.toString(HttpState.java:634)
        at java.lang.String.valueOf(String.java:2013)
        at java.lang.StringBuffer.append(StringBuffer.java:365)
        at 
org.apache.cactus.util.CookieUtil.createHttpState_aroundBody15$advice(CookieUtil.java:190)
        at 
org.apache.cactus.util.CookieUtil.createHttpState(CookieUtil.java)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:169)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
com.axa.eplatform.FormAuthentication.authenticate(FormAuthentication.java:245)
        at 
com.axa.eplatform.FormAuthentication.configure(FormAuthentication.java:156)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:126)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:201)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:119)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:22
2)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281
)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.ServletTestCase.runCactusTest(ServletTestCase.java:300)
        at 
org.apache.cactus.ServletTestCase.runBare(ServletTestCase.java:263)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:313)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:151)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
        at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
        at 
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
        at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)

2004/02/19 12:45:29:294 EST [DEBUG] XMLFormatter - 
-<addError([testIsUserLoggedIn(com.axa.eplatform.beaweblogic70.usermg
mt.TestUserAccessManagement)], 
[org.apache.cactus.util.ChainedRuntimeException: Failed to authenticate 
the principal])
2004/02/19 12:45:29:294 EST [DEBUG] StringUtil - 
-<exceptionToString([org.apache.cactus.util.ChainedRuntimeException: Fa
iled to authenticate the principal], [[Ljava.lang.String;@757564])
2004/02/19 12:45:29:294 EST [DEBUG] ChainedRuntimeException - 
-<printStackTrace([java.io.PrintWriter@6e0aad])
2004/02/19 12:45:29:294 EST [DEBUG] ChainedRuntimeException - 
->printStackTrace
2004/02/19 12:45:29:294 EST [DEBUG] StringUtil - ->exceptionToString = 
[org.apache.cactus.util.ChainedRuntimeException:
Failed to authenticate the principal
        at 
com.axa.eplatform.FormAuthentication.authenticate(FormAuthentication.java:315)
        at 
com.axa.eplatform.FormAuthentication.configure(FormAuthentication.java:156)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:126)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:201)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:119)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:22
2)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281
)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:313)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:151)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
        at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
        at 
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
        at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
java.lang.NoSuchMethodError
        at 
org.apache.commons.httpclient.HttpState.toString(HttpState.java:634)
        at java.lang.String.valueOf(String.java:2013)
        at java.lang.StringBuffer.append(StringBuffer.java:365)
        at 
org.apache.cactus.util.CookieUtil.createHttpState_aroundBody15$advice(CookieUtil.java:190)
        at 
org.apache.cactus.util.CookieUtil.createHttpState(CookieUtil.java)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:169)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
com.axa.eplatform.FormAuthentication.authenticate(FormAuthentication.java:245)
        at 
com.axa.eplatform.FormAuthentication.configure(FormAuthentication.java:156)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody0(HttpClientConnectionHe
lper.java:126)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect_aroundBody1$advice(HttpClientConne
ctionHelper.java:222)
        at 
org.apache.cactus.client.connector.http.HttpClientConnectionHelper.connect(HttpClientConnectionHelper.java)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.callRunTest(DefaultHttpClient.java:201)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody0(DefaultHttpClient.java:119)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest_aroundBody1$advice(DefaultHttpClient.java:22
2)
        at 
org.apache.cactus.client.connector.http.DefaultHttpClient.doTest(DefaultHttpClient.java)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runWebTest(WebClientTestCaseDelegate.java:333)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runGenericTest(WebClientTestCaseDelegate.java:281
)
        at 
org.apache.cactus.internal.client.WebClientTestCaseDelegate.runTest(WebClientTestCaseDelegate.java:257)
        at 
org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:313)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:209)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:151)
        at 
org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
        at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
        at 
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
        at 
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
        at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
        at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
]
2004/02/19 12:45:29:309 EST [DEBUG] XMLFormatter - ->addError
2004/02/19 12:45:29:309 EST [DEBUG] XMLFormatter - 
-<endTest([testIsUserLoggedIn(com.axa.eplatform.beaweblogic70.usermgm
t.TestUserAccessManagement)])



Please respond to "Cactus Users List" <cactus-user@jakarta.apache.org>
To:     cactus-user@jakarta.apache.org
cc: 

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

Hi Ankur,

In article 
<OF7C45C9CA.0658882B-ONCA256E3F.0002B78B-CA256E3F.0003B952@nm.com.au>,
Thu, 19 Feb 2004 11:40:27 +1100,
ankur.kumar@axa.com.au wrote: 
ankur.kumar> ServletRedirectorSecure was not secured, but now it is.
[...]
ankur.kumar> org.apache.cactus.util.ChainedRuntimeException: Unable to 
login, probably 
ankur.kumar> due to bad username/password. Received a [200]
ankur.kumar>  response code and was expecting a [302]

This is the problem.

As I reported in the last post, the response of the Step (4) is
expected to be "HTTP/1.1 302 Moved Temporarily".

This means that the Cactus (FormAuthentication) is expecting that
the security_check (j_security_check in the default) results
a redirection to the protected resource if the authentication is 
succeeded.

If you are using custom authentication mechanism,
which is specified by 
FormAuthentication#setSecurityCheckURL(java.net.URL),
it should implement this behaviour.

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

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






*********************************************************************************
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.
*********************************************************************************


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message