in src/main/java/com/microsoft/azure/spark/tools/http/HttpObservable.java [106:134]
public HttpObservable(final @Nullable String username, final @Nullable String password) {
// String loadingClass = this.getClass().getClassLoader().getClass().getName().toLowerCase();
// this.userAgentPrefix = loadingClass.contains("intellij")
// ? "Azure Toolkit for IntelliJ"
// : (loadingClass.contains("eclipse")
// ? "Azure Toolkit for Eclipse"
// : "Azure HDInsight SDK HTTP RxJava client");
this.cookieStore = new BasicCookieStore();
this.httpContext = new BasicHttpContext();
// Create global request configuration
this.defaultRequestConfig = RequestConfig.custom()
.setCookieSpec(CookieSpecs.DEFAULT)
.setTargetPreferredAuthSchemes(Arrays.asList(
AuthSchemes.KERBEROS, AuthSchemes.DIGEST, AuthSchemes.BASIC))
.setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC))
.build();
if (StringUtils.isNotBlank(username) && password != null) {
String auth = username + ":" + password;
encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1));
} else {
encodedAuth = new byte[0];
}
this.userAgents.add(Versions.DEFAULT_USER_AGENT.get().toString());
}