Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 85401 invoked from network); 25 Oct 2007 15:02:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Oct 2007 15:02:43 -0000 Received: (qmail 60967 invoked by uid 500); 25 Oct 2007 15:02:17 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 60942 invoked by uid 500); 25 Oct 2007 15:02:17 -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 60931 invoked by uid 99); 25 Oct 2007 15:02:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 08:02:17 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of funkman@joedog.org designates 204.74.20.252 as permitted sender) Received: from [204.74.20.252] (HELO sid.armstrong.com) (204.74.20.252) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Oct 2007 17:03:04 +0000 Received: from [10.38.22.14] (tafunk-lt.americas.armstrong.com [10.38.22.14]) by sid.armstrong.com (8.13.6/8.12.8) with ESMTP id l9PEss5O027071 for ; Thu, 25 Oct 2007 10:54:54 -0400 Message-ID: <4720AFE7.6000108@joedog.org> Date: Thu, 25 Oct 2007 11:01:59 -0400 From: Tim Funk Organization: Human Being User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: JDBC Realm with case insensitive user name References: <4720941A.2050508@gmail.com> <47209790.5030302@joedog.org> <47209976.7080608@gmail.com> In-Reply-To: <47209976.7080608@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In that case - (I think) it probably won't work - override instead: protected PreparedStatement credentials(Connection dbConnection, String username) protected synchronized PreparedStatement roles(Connection dbConnection, String username) Where in both instances you call the super() version with a lower username. Then in config - make sure your userNameCol="lower(USER_NAME)" - of course using your username and lower DB implementation. -Tim Pedro wrote: > Thanks for stating the obvious Tim, in 5.5 the 'server' directory is > supposed to be the correct place! the question is if the implementation > is valid. > > Tim Funk wrote: >> The dir structure changed from 5.5 to 6 so you need to place your >> files in different directories depending on the version. See the >> version specific docs details. >> >> >> -Tim >> >> Pedro wrote: >>> Hi all, >>> >>> I basically need to implement case insensitive user names, can this >>> be done with a servlet filter or do I need to subclass JDBC realm: >>> >>> public class CustomJdbcRealm extends JDBCRealm { >>> >>> public CustomJdbcRealm() { >>> super(); >>> } >>> public Principal authenticate(String username, String >>> credentials) { >>> return super.authenticate(username.toLowerCase(), credentials); >>> } >>> } >>> >>> And in server.xml: >>> >>> >>> I tried this approach but get class not found exceptions, I am using >>> tomcat6 in development and 5.5 in production. I package this class in >>> a jar and drop it in the $CATALENA_BASE/server/lib folder. >>> >> --------------------------------------------------------------------- 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