Encode username/passwrod pair instead of decoding it while creating request.

(cherry picked from commit 0cda72e6b2847c1baee498d2971bb3431b1d1895)
This commit is contained in:
devaskim 2025-02-09 17:32:36 +05:00 committed by ViacheslavKlimov
parent 3cb140a76a
commit 4cd5e0369d

View File

@ -343,7 +343,7 @@ public class TbHttpClient {
if (CredentialsType.BASIC == credentials.getType()) {
BasicCredentials basicCredentials = (BasicCredentials) credentials;
String authString = basicCredentials.getUsername() + ":" + basicCredentials.getPassword();
String encodedAuthString = new String(Base64.getDecoder().decode(authString.getBytes(StandardCharsets.UTF_8)));
String encodedAuthString = new String(Base64.getEncoder().encode(authString.getBytes(StandardCharsets.UTF_8)));
headers.add("Authorization", "Basic " + encodedAuthString);
}
}