Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Client Authentication with Tomcat(Can't extract the user principal)
Client Authentication with Tomcat [message #674652] Fri, 27 May 2011 17:43 Go to next message
Mark Leone is currently offline Mark LeoneFriend
Messages: 123
Registered: July 2009
Senior Member
I have a RAP app running in Tomcat 6.x, with an SSL Connector configured to require client authentication (clientAuth="true"). The browser sends a cert to the server, as verified by requiring user confirmation. However when I try to access the User principal from the RAP app, it's null.

Here's the code I'm using, in the init() method of an editor. I also tried it in createPartControl().

RWT.requestThreadExec( new Runnable() {
    run() {
         Principal user = RWT.getRequest().getUserPrincipal();
         ...
    }
} );


With the above, user is always null. I'm able to access the SSL session ID, however, with RWT.getRequest().getAttribute("javax.servlet.request.ssl_session")

I don't have any security constraints defined in the web app's web.xml, since the ssl connector requires client authentication. Is that required, in order to have a User Principal present on the session?
Re: Client Authentication with Tomcat [message #674717 is a reply to message #674652] Sat, 28 May 2011 02:47 Go to previous message
Mark Leone is currently offline Mark LeoneFriend
Messages: 123
Registered: July 2009
Senior Member
Defining an auth-constraint in web.xml caused the user principal to be available in the HttpServletRequest. A description of how to associate the username/role defined in a realm with the DN from the cert can be found here.
Previous Topic:Problem in drawing transparent image
Next Topic:I can use 'clipboard'
Goto Forum:
  


Current Time: Thu Apr 18 10:31:23 GMT 2024

Powered by FUDForum. Page generated in 0.02692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top