users@glassfish.java.net

Can not access user id info from JSP app running under Glassfish

From: <forums_at_java.net>
Date: Mon, 8 Aug 2011 10:44:06 -0500 (CDT)

We are running Glassfish 3.1on a Sun under Solaris 10.  I have been tasked
with getting an existing JSP app to use User Certificate Authentication.

I have configured GS to run with SSL/STL and to authenticate via the
certificates (user is prompted for certificate by browser).

However, for the authentications, the user finds the process of maintaining
an XML file in the deployment unacceptable so I need to perform
authorization from within the application.  I would have thought that this
would be a simple task. However, I can not get user info from the
HttpServletRequest.  Both the calls getRemoteUser() and getUserPrinciple()
return null's.  In fact the call getAuthTyoe() also returns null or blanks.

I suspect that the reason is that these values are obtained from the
XML fields.  But when I try to verify this by adding the authorized role in
the web.xml and the role mappings go a principal user name in the
sun-web.xml, I can no longer get the user to authenticate. 

Any help as to how to get the ID of the authenticated user in the
application???


--
[Message sent by forum member 'BDBertien']
View Post: http://forums.java.net/node/830777