Browse Source
Encode username/passwrod pair instead of decoding it while creating request.
pull/12640/head
devaskim
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
1 deletions
-
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/rest/TbHttpClient.java
|
|
|
@ -347,7 +347,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); |
|
|
|
} |
|
|
|
} |
|
|
|
|