users@glassfish.java.net

Cannot login with password containing non-ascii characters

From: <glassfish_at_javadesktop.org>
Date: Thu, 15 May 2008 08:09:18 PDT

Hello,

I have web application, form based login. UTF-8 is specified "everywhere".
And it works, except for passwords.
If user register itself with password containing non-ascii characters (Chinese, Arabish, Russian alphabet...), it is correctly written in database, but when doing either programmatic login or normal form based login, if fails.
If the password is only ascii, it works.
Username of login could be ascii or non-ascii, it doesn't matter, both works (with ascii only pass).

I'm using sun java application server 9.1.
jdbc realm.
I tried both clean passwords and MD5 passwords (set in jdbc realm and hashed in registration), but both seem to have the same problem. As soon as I use non-ascii character in password, it fails.

It seems strange, users in China, Russia and so on, should switch keyboard language before inputing password? I doubt they would.
However I tried everything I could find, even the MD5 hashing, which (because of hashing into ascii) I expected would resolve this problem. But it didn't.

Please, tell me, what I am doing wrong, or is that a bug?
Is it unusual feature? I don't think so, see above the real life ex.

is it bug in server or between client and server? (but really, the utf-8 is working in all pages in my app, all forms, everywhere, just login, which is jdbcrealm)

Any help very appreciated

Thanks a lot
[Message sent by forum member 'miira' (miira)]

http://forums.java.net/jive/thread.jspa?messageID=274594