tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: of the different methods to get a user-id
Date Thu, 12 Feb 2009 18:22:44 GMT
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: of the different methods to get a user-id
>
> > I would expect
> > request.getRemoteUser() == request.getUserPrincipal().getName()
> > But there no literature which says that must be so.
>
> And the reality shows it isn't.
> So somehow there must be two distinct underlying "thingies" in Tomcat
> where the two different answers are coming from.

As Pid surmised, it's not Tomcat that is giving you different answers.  Here's Tomcat's implementation
of HttpServletRequest.getRemoteUser():

    public String getRemoteUser() {
        if (userPrincipal != null) {
            return (userPrincipal.getName());
        } else {
            return (null);
        }
    }

[Aside: Don't know why people think return statements need parentheses; maybe they get paid
for programming based on the number of characters used.]

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

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


Mime
View raw message