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", "Admin1234"));
httpClient = new DefaultHttpClient(new
ThreadSafeClientConnManager());
httpClient.setCredentialsProvider(credsProvider);
...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
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]