[
http://jira.jboss.com/jira/browse/JBAS-3445?page=comments#action_12365539 ]
Haohua xie commented on JBAS-3445:
----------------------------------
My Solution:
I am a chinese and I am writing a website for chinese. every page in my web site is of
utf-8. I use form-based authentication and
org.jboss.security.auth.spi.DatabaseServerLoginModule to authenticate my users. When some
of my users create their accounts with chinese characters in their login id, they
can't login because DatabaseServerLoginModule can't get the correctly-encoded
username. So I debug into jboss authentication module. I tried to filter all request to
use UTF-8 ,but I failed because authectiation request can't be filtered by the filters
defined in /WEB-INF/web.xml. I find that the DatabaseServerLoginModule can't get the
encoded username corretly only because the username can't be correctly fechted from
request by org.apache.catalina.authenticator.FormAuthenticator. So I need to configure
org.apache.catalina.authenticator.FormAuthenticator in order to get utf-8 encoded
username.
i find the configuration here:
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
I add a context.xml to /WEB-INF/ and deploy to my jboss server. Now the username can be
fetched correctly now and my users can use chinese characters in their login id;
my context.xml:
<Context>
<Valve
className="org.apache.catalina.authenticator.FormAuthenticator"
characterEncoding="UTF-8" />
</Context>
my jboss is 4.20.GA
Testcase for UTF-8 support with FORM Authentication
---------------------------------------------------
Key: JBAS-3445
URL:
http://jira.jboss.com/jira/browse/JBAS-3445
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Security
Affects Versions: JBossAS-4.0.4.GA
Reporter: Anil Saldhana
Assigned To: Anil Saldhana
Fix For: JBossAS-4.2.1.CR1
User says:
========================================================
I have run into as well using JBoss 4.0.3SP1 (and 4.0.4GA).
In my Web Applications, I can login with English usernames and passwords just fine.
But when I try to login with a Russian or Chineese username, the login always fails.
From the tracing I've done, it seems the username is getting converted to ISO-8859-1,
and that's why it's failing.
I've done all the "standard" things to make our pages UTF-8, and this does
work on every page except the login page. Something about "j_security_check" is
ignoring UTF-8 and forcing a conversion to "ISO-8859-1".
=========================================================
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira