aspose file tools*
The moose likes JDBC and the fly likes case sensitivity with JDBCRealm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "case sensitivity with JDBCRealm" Watch "case sensitivity with JDBCRealm" New topic
Author

case sensitivity with JDBCRealm

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Our Tomcat machine's server.xml file has the following element in it for authenticating website users:



Basically out of the textbook...but the problem is, we're moving from MySQL to Oracle, and the MySQL database wasn't case sensitive when checking the username. Do you think this is specifically related to the Oracle driver? Is there any way to turn off case insensitivity when checking the username in the Oracle database?

Thanks...

[edited to disable smilies and add line breaks so page doesn't scroll right]
[ February 08, 2005: Message edited by: Jeanne Boyarsky ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

Stephen,
Many databases, not just Oracle, are case sensitive when it comes to usernames and passwords. As they should be, since this is more secure.

There isn't a way to turn off this feature, so you are going to have to modify your file.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I agree wholeheartedly, but FastMail, Yahoo Mail, GMail, and my credit card company's website all allow you to enter your username in mixed case! Our users are used to this, so in order to migrate to Oracle, it would be great to be able to continue supporting this feature.

I'm not sure this is what I want to do, but I was trying to Google around and search the Apache websites to figure out how to get ahold of the source behind JDBCRealm to see about modifying the queries it sends to the database to ignore case. I haven't found it yet, though...
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Stephen Huey:
I agree wholeheartedly, but FastMail, Yahoo Mail, GMail, and my credit card company's website all allow you to enter your username in mixed case! Our users are used to this, so in order to migrate to Oracle, it would be great to be able to continue supporting this feature.

I'm not sure this is what I want to do, but I was trying to Google around and search the Apache websites to figure out how to get ahold of the source behind JDBCRealm to see about modifying the queries it sends to the database to ignore case. I haven't found it yet, though...


Moreover,
- if you write any URL in the address bar of the browser it will automatically converted into lowercase.

- if you try to mail me using address "ADEEL.GNOME@GMAIL.COM"instead of "adeel.gnome@gmail.com". You will get the success. Again it will automatically converted to lowercase as lowercase is standard.

But password needs correct case, because it is something really matters for security reasons.

May be any of the companies you mentioned is working with oracle database and doing ignorecase somewhere in the code.

And i dont think you can't register on yahoo or someother mail service with a uppercase username. Therefore, they know that they have all the username in lowercase inside their DB as they dont allow uppercase in username. Hence they just convert the username to lowercase while you send request to login.
[ February 08, 2005: Message edited by: Adeel Ansari ]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
you can do like this,

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I don't want to check the password case insensitively--just the username. We use JDBCRealm in Tomcat to manage which users get to access which parts of the site, so that's why I'd rather not do away with JDBCRealm for a custom solution. But if we're going to continue to use it, it looks like my boss might make me figure out how to allow users to type in their username in mixed case when logging in.

For this reason, I'm trying to figure out how to get ahold of the source to JDBCRealm. I know the Apache folks reorganized their website not too long ago, but I can't find the Realm stuff, and no one responded to me on the Tomcat users' list, so I'm not sure what it falls under. While it may or may not be part of Tomcat 5, I know it's separate in Tomcat 4, which is what we're running.

Even if I do get ahold of the source, I'm not sure how confident I am that I'll get it to do what I want...I just want to change the query it sends to Oracle to do a case insensitive check on the username.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: case sensitivity with JDBCRealm