How to use UTF-8 in basic and digest access authentication
SailReal opened this issue · 7 comments
okhttp
does support providing different char-sets for authentication. Using the default of okhttp
which is ISO_8859_1
I've problems with some servers and chars e.g. "äöü" and want to switch to UTF-8
.
How can I archive this using basic and digest access authentication and this library?
If I provide the authentication directly to okhttp
using UTF-8
my Nextcloud accepts chars like "äöü" in the password.
.authenticator((route, response) -> {
String credential = okhttp3.Credentials.basic("test", "äöüäöüäöü", UTF_8);
return response.request().newBuilder().header("Authorization", credential).build();
})
hm, will check this. Sorry, didnt read the 2nd part of your ticket.
hm, will check this. Sorry, didnt read the 2nd part of your ticket.
Thanks, if you need further information or a test account please let me know.
released 2.4 which adds the ability to provide the charset.
Woooow impressive, thanks for the quick implementation 🚀!
I have already tested it, it works, thanks!
Can you please add it for digest access authentication too?
@rburgst is there a chance that the UTF-8
charset finds a way also in the DigestAuthenticator?
@SailReal okhttp-digest is currently a straight up port of https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/DigestScheme.java, does it work with apache HC?