On 01/29/10 17:46, Raj Kaushik wrote:
Hi I am trying to manually pass certifcate to the server before
authentication. But so far I am not successful.
The standard way to store things that must survive a request/response
cycle is in the Session. See the java doc for Session and Application:
"Session Properties - Arbitrary objects can be attached to a Session by
installing a session factory on your Application class which creates
custom Session subclasses that have typesafe properties specific to the
application (see Application for details). [...]"
-- Thomas
// -- In the test client --
//WebApplication object is given wicketTester = new
WicketTester(webApp);
wicketTester.getApplication().getResourceSettings().setResourceStreamLocator(new
CustomResourceStreamLocator()); //An attribute is set to the request
MockHttpServletRequest request = wicketTester.getServletRequest();
request.setAttribute("javax.servlet.request.X509Certificate",
readCertificate());
wicketTester.startPage(SignIn.class);
// -- In the Server side // During DEBUG I trace the call to the
following 2 times // One: when new Wicket Tester is created // Two:
after startPage
WebRequest webRequest = (WebRequest)request; HttpServletRequest
servletRequest = webRequest.getHttpServletRequest(); X509Certificate
certs[] =
(X509Certificate[])servletRequest.getAttribute("javax.servlet.request.X509Certificate");
if(certs != null){ setClientCertificate(certs[0]); }
The problem is that the certificates are always null. How is it
possible to pass on the object to the server side at the right time
of the life cycle.
Any help or suggestions are highly appreciated.
Raj Kaushik [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
-------------------------------------------------------------------
Thomas Kappler [email protected]
Swiss Institute of Bioinformatics Tel: +41 22 379 51 89
CMU, rue Michel Servet 1
1211 Geneve 4
Switzerland http://www.uniprot.org
-------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]