tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: JDBC Realm with case insensitive user name
Date Thu, 25 Oct 2007 15:01:59 GMT
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:
>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>
>>> 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


Mime
View raw message