if (remotePassword != null) {
try {
URL urlParsed = new URL(url);
String host = urlParsed.getHost();
CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(new AuthScope(host, AuthScope.ANY_PORT), new UsernamePasswordCredentials(
remoteUsername, remotePassword));
clientBuilder.setDefaultCredentialsProvider(credentialsProvider);
isAuthConfigured = true;
} catch (MalformedURLException e) {
// this should never happen due validation before