Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 60281 invoked from network); 12 Feb 2009 18:23:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2009 18:23:35 -0000 Received: (qmail 23490 invoked by uid 500); 12 Feb 2009 18:23:20 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 23475 invoked by uid 500); 12 Feb 2009 18:23:19 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 23464 invoked by uid 99); 12 Feb 2009 18:23:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 10:23:19 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.61.61.105] (HELO usea-naimss3.unisys.com) (192.61.61.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 18:23:08 +0000 Received: from usea-nagw3.na.uis.unisys.com ([129.224.72.20]) by usea-naimss3 with InterScan Message Security Suite; Thu, 12 Feb 2009 12:22:46 -0600 Received: from usea-nagw3.na.uis.unisys.com ([129.224.72.55]) by usea-nagw3.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Feb 2009 12:22:46 -0600 Received: from usea-nahubcas1.na.uis.unisys.com ([129.224.76.114]) by usea-nagw3.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Feb 2009 12:22:46 -0600 Received: from USEA-EXCH7.na.uis.unisys.com ([129.224.76.38]) by usea-nahubcas1.na.uis.unisys.com ([129.224.76.114]) with mapi; Thu, 12 Feb 2009 12:22:45 -0600 From: "Caldarale, Charles R" To: Tomcat Users List Date: Thu, 12 Feb 2009 12:22:44 -0600 Subject: RE: of the different methods to get a user-id Thread-Topic: of the different methods to get a user-id Thread-Index: AcmNIlQ5JWMhr3UPSjmYumo86SioCwAG14YQ Message-ID: <0AAE5AB84B013E45A7B61CB66943C17215B62FB6C3@USEA-EXCH7.na.uis.unisys.com> References: <4994204D.90900@ice-sa.com> <4994337C.2030700@joedog.org> <4994378A.3020107@ice-sa.com> In-Reply-To: <4994378A.3020107@ice-sa.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 12 Feb 2009 18:22:46.0012 (UTC) FILETIME=[E704F3C0:01C98D3E] X-Virus-Checked: Checked by ClamAV on apache.org > From: Andr=E9 Warnier [mailto:aw@ice-sa.com] > Subject: Re: of the different methods to get a user-id > > > I would expect > > request.getRemoteUser() =3D=3D 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. Her= e's Tomcat's implementation of HttpServletRequest.getRemoteUser(): public String getRemoteUser() { if (userPrincipal !=3D null) { return (userPrincipal.getName()); } else { return (null); } } [Aside: Don't know why people think return statements need parentheses; may= be they get paid for programming based on the number of characters used.] - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MA= TERIAL 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 atta= chments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org