hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Pohl (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1528) UTF-8 characters in user names not supported in Basic Authentication
Date Tue, 15 Jul 2014 14:52:04 GMT
Christoph Pohl created HTTPCLIENT-1528:

             Summary: UTF-8 characters in user names not supported in Basic Authentication
                 Key: HTTPCLIENT-1528
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1528
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpAuth
    Affects Versions: 4.2.6
            Reporter: Christoph Pohl

If you try to use UTF-8 characters like the Euro sign ("€") in user names, httpclient does
not compose the correct Base64-encoded basic authentication header. Suppose the following
piece of code:

		CredentialsProvider credsProvider = new BasicCredentialsProvider();
		credsProvider.setCredentials(new AuthScope(post, port), new UsernamePasswordCredentials("€uro",
		httpClient = new DefaultHttpClient(new ThreadSafeClientConnManager());

...which results an Authentication header "Basic P1VSTzpBZG1pbjEyMzQ=" (equals to decoded
"?URO:Admin1234"). However, browsers like Google Chrome correctly encode "Basic 4oKsdXJvOkFkbWluMTIzNA=="
(equals to decoded "€uro:Admin1234").

Sorry if this bug has been reported already.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message