users@glassfish.java.net

Asserting a user and access logging

From: Sam Crawford <samcrawford_at_gmail.com>
Date: Thu, 16 Jul 2009 12:08:59 +0100

Morning all,
Probably a fairly silly question, but I've googled and can't find the
answer, so I'll ask here.

We've written a custom authentication server filter that interacts with an
SSO server. Now, we want to log the authenticated username as a part of the
log line in the GlassFish access log. I had imagined this would be simply a
case of wrapping the request in an HttpServletRequestWrapper and overriding
getRemoteUser and getUserPrincipal. However, after doing this, the username
recorded in the access log is still NULL-AUTH-USER.

Does anyone know how to properly assert an identity such that it is logged
properly by GlassFish into the access log?

Thanks,

Sam