tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Get Security subject from Tomcat
Date Wed, 12 Nov 2008 23:24:04 GMT
Arash Bizhan zadeh wrote:
> On Wed, Nov 12, 2008 at 4:06 PM, Caldarale, Charles R <
> Chuck.Caldarale@unisys.com> wrote:
> 
>>> From: Arash Bizhan zadeh [mailto:arashbi@gmail.com]
>>> Subject: Get Security subject from Tomcat
>>>
>>> Is there is was I can get the authenticated User from inside my
>>> servlet/filter?
>> Perhaps reading the Servlet spec or the APIs would help:
>>
>> http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpServletRequest.html#getUserPrincipal()<http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/javax/servlet/http/HttpServletRequest.html#getUserPrincipal%28%29>
> 
> 
> Sure it might help. Reading my mail would have helped too. I need the
> Subject not the principal.
> 
As much as some of us would sometimes enjoy someone being able to 
(figuratively) slap the Servlet Spec in Chuck's face, it being justified 
does not happen very often.
Isn't what he indicated above, what you were requesting in the first place ?

java.security.Principal principal = request.getUserPrincipal();
String userId = principal.getName();



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message