tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Bellavia (JIRA)" <>
Subject [jira] [Created] (TOMEE-1470) Login not successful due to encoding problem using login-config auth-method FORM
Date Fri, 05 Dec 2014 11:15:12 GMT
Marco Bellavia created TOMEE-1470:

             Summary: Login not successful due to encoding problem using login-config auth-method
                 Key: TOMEE-1470
             Project: TomEE
          Issue Type: Bug
    Affects Versions: 1.7.1
         Environment: CentOS
            Reporter: Marco Bellavia

Our ear application comes with an authentication configuration in web.xml as follows:


We noticed that the authentification with a password containing special characters (for example
umlauts) fails with our TomEE instance running on CentOS Linux (while on Windows the problem
does not occur).
Our application was previously deployed on a Glassfish 3.1, where we were not experiencing
the phenomen just described. There we could configure the default charset using the directive
<parameter-encoding default-charset="UTF-8"/> in sun-web.xml.
All other encoding configurations are set to UTF-8.
We notice the following while debugging under TomEE: calling the method getCharacterEncoding()
on the ServletRequest returns NULL, which implies that TomEE takes as default ISO-8859-1 on

As recommended here: we set a character
encoding filter. On TomEE the recommended solution doesn't seem to be working. A SetCharacterEncodingFilter
was placed as first in the chain setting the encoding to UTF-8.
We assume that setting the encoding of the request on a TomEE - as the filter does - happens
too late.

As workaround we implemented a customized jdbc-realm class, where we convert the encoding
to UTF-8 by:

    public Principal authenticate(final String username, final String credentials) {
    	final String utf8EncodedCredentials = new String(credentials.getBytes("ISO-8859-1"),"UTF-8");

We would welcome a general solution.

This message was sent by Atlassian JIRA

View raw message