You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Toshiaki Kikuchi <to...@yahoo.co.jp> on 2006/08/31 18:41:39 UTC

mulit-byte character username in DataSoureRealm

Hi,

I would like to use username with multi-byte character(Shift-JIS)
in FORM BASED Authentication of DataSourceRealm. But it does not work.
username with ascii character works well.
The reason seems that encoding of ServletRequest.getParameter() in
FormAuthenticator.java does not work.
Is it possible by changing setting of Tomcat?

The authentication passes when I add
ServletRequest.setCharacterEncoding("Shift_JIS")
by hand to FormAuthenticator.java which is in the tomcat source code
and use it. But for this case, username of
ServletRequest.getRemoteUser() is not correctly encoded.

Thank in advance.

--------------------------------------
For All Sports Lovers!
http://pr.mail.yahoo.co.jp/yells/

---------------------------------------------------------------------
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


Re: mulit-byte character username in DataSoureRealm

Posted by Toshiaki Kikuchi <to...@yahoo.co.jp>.
Hi Mark,

Thank you for your help.
This is the information I need!

-Kikuchi

Mark Thomas wrote:
> Toshiaki Kikuchi wrote:
>   
>> Hi,
>>
>> I would like to use username with multi-byte character(Shift-JIS)
>> in FORM BASED Authentication of DataSourceRealm. But it does not work.
>> username with ascii character works well.
>> The reason seems that encoding of ServletRequest.getParameter() in
>> FormAuthenticator.java does not work.
>> Is it possible by changing setting of Tomcat?
>>
>> The authentication passes when I add
>> ServletRequest.setCharacterEncoding("Shift_JIS")
>> by hand to FormAuthenticator.java which is in the tomcat source code
>> and use it. But for this case, username of
>> ServletRequest.getRemoteUser() is not correctly encoded.
>>     
>
> Look at the bottom of
> http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
>
> You want the characterEncoding attribute of the FormAuthenticator valve.
>
> Mark
>
>   
>> Thank in advance.
>>
>> --------------------------------------
>> For All Sports Lovers!
>> http://pr.mail.yahoo.co.jp/yells/
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> 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
>
>
>   

--------------------------------------
For All Sports Lovers!
http://pr.mail.yahoo.co.jp/yells/

---------------------------------------------------------------------
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


Re: mulit-byte character username in DataSoureRealm

Posted by Mark Thomas <ma...@apache.org>.
Toshiaki Kikuchi wrote:
> Hi,
> 
> I would like to use username with multi-byte character(Shift-JIS)
> in FORM BASED Authentication of DataSourceRealm. But it does not work.
> username with ascii character works well.
> The reason seems that encoding of ServletRequest.getParameter() in
> FormAuthenticator.java does not work.
> Is it possible by changing setting of Tomcat?
> 
> The authentication passes when I add
> ServletRequest.setCharacterEncoding("Shift_JIS")
> by hand to FormAuthenticator.java which is in the tomcat source code
> and use it. But for this case, username of
> ServletRequest.getRemoteUser() is not correctly encoded.

Look at the bottom of
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

You want the characterEncoding attribute of the FormAuthenticator valve.

Mark

> 
> Thank in advance.
> 
> --------------------------------------
> For All Sports Lovers!
> http://pr.mail.yahoo.co.jp/yells/
> 
> ---------------------------------------------------------------------
> 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
> 
> 


---------------------------------------------------------------------
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